Skip to content

Commit

Permalink
Fixed the Hectic If else Loop....
Browse files Browse the repository at this point in the history
  • Loading branch information
SayedZeeshanHyder committed Jul 28, 2024
1 parent e745510 commit d082b37
Showing 1 changed file with 36 additions and 8 deletions.
44 changes: 36 additions & 8 deletions lib/new_ui/screens/AnnouncementScreen/announcementscreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,24 +86,52 @@ class _AnnouncementScreenState extends ConsumerState<AnnouncementScreen> {
return listTile;
}

//Condition if it is for all
if(announcement.batch!.contains("All")) {
//Condition for All Grad Year
if(announcement.gradYear!.contains("All")) {
return listTile;
}

//Condition if the student cannot see the Announcement
if(studentModel!.branch != announcement.branch || studentModel!.batch != announcement.batch || studentModel!.div != announcement.div || studentModel!.gradyear != announcement.gradYear) {
return SizedBox();
//Condition for Student Matches Grad Year
if(announcement.gradYear == studentModel!.gradyear){

//Condition to match all Batches of that Grad Year
if(announcement.branch!.contains("All")){
return listTile;
}

//Student Belongs to the Same Branch
if(announcement.branch == studentModel!.branch){

//All Divisions of that branch
if(announcement.div!.contains("All")){
return listTile;
}

//Student is in the Same Division
if(announcement.div == studentModel!.div){

//All Batches of Same Division
if(announcement.batch!.contains("All")){
return listTile;
}

if(announcement.batch == studentModel!.batch){
return listTile;
}

}
}
}

//The Announcement Belongs to Student
return Column(
return SizedBox();

/*return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
_buildDateHeader(_parseTimestamp(announcement.startDate)),
listTile,
],
);
);*/
},
);
}
Expand Down

0 comments on commit d082b37

Please sign in to comment.