Skip to content

Commit

Permalink
Merge pull request #179 from SayedZeeshanHyder/main
Browse files Browse the repository at this point in the history
Added Fourth Stepper and Fixed Filter in Notes
  • Loading branch information
SayedZeeshanHyder authored Jul 6, 2024
2 parents 76329b3 + f5b9f25 commit c2cf17d
Show file tree
Hide file tree
Showing 9 changed files with 221 additions and 282 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,21 @@ class ConcessionRequestModel {
final DateTime time;
@JsonKey(name: "uid")
final String uid;
@JsonKey(name: "passCollected")
final Map<String,dynamic>? passCollected;

ConcessionRequestModel({
ConcessionRequestModel( {
this.passCollected,
this.passNum,
required this.status,
required this.statusMessage,
required this.time,
required this.uid,
});

factory ConcessionRequestModel.fromJson(Map<String, dynamic> json) =>
_$ConcessionRequestModelFromJson(json);
factory ConcessionRequestModel.fromJson(Map<String, dynamic> json) {
return _$ConcessionRequestModelFromJson(json);
}

Map<String, dynamic> toJson() => _$ConcessionRequestModelToJson(this);
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/new_ui/screens/notes_screen/notes_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ class _NotesScreenState extends ConsumerState<NotesScreen> {

void changeFilters(DateTime? startDate, DateTime? endDate, bool latest,
List<String> subjects) {
print("Filtered Subjects = ${subjects}");
setState(() {
filterStartDate = startDate;
filterEndDate = endDate;
Expand Down
267 changes: 135 additions & 132 deletions lib/new_ui/screens/notes_screen/widgets/note_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,142 +118,145 @@ class _NoteListState extends ConsumerState<NoteList> {
}
return newString;
}).toList();

return Column(
children: [
SizedBox(height: 10),
i == 0 || allNotes[i].time != allNotes[i - 1].time
? Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
formatDate(allNotes[i].time),
style: TextStyle(
color: Colors.grey,
),
)
],
)
: Container(),
SizedBox(
height:
i == 0 || allNotes[i].time != allNotes[i - 1].time
? 15
: 0),
Padding(
padding: EdgeInsets.all(8),
child: OpenContainer(
transitionDuration: Duration(milliseconds: 500),
closedColor: Color(0xff1B1B1B),
closedBuilder: (context, action) {
return Container(
// margin: EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: Color(0xff383838),
),
child: Padding(
padding: const EdgeInsets.all(20,),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"${allNotes[i].subject}: ${allNotes[i].title}",
style: Theme.of(context)
.textTheme
.titleMedium!
.copyWith(color: Colors.white),
),
const SizedBox(
height: 7,
),
Text(
/* use can use the
_getFirst5Words method here if want to
_getFirst5Words(widget.noteContent)
method on line no. 40
*/
allNotes[i].description,
// widget.noteContent,
style: Theme.of(context)
.textTheme
.titleSmall!
.copyWith(color: Colors.grey, fontSize: 14),
if(widget.subjects.contains(allNotes[i].subject))
return Column(
children: [
SizedBox(height: 10),
i == 0 || allNotes[i].time != allNotes[i - 1].time
? Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
formatDate(allNotes[i].time),
style: TextStyle(
color: Colors.grey,
),
const SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
width:
MediaQuery.of(context).size.width *
.8,
height: 40,
child: ListView.builder(
scrollDirection: Axis.horizontal,
itemCount:
min(2, attachments.length),
itemBuilder: (context, ind) {
return CustomPdfIcon(
pdfName: attachments[ind],
);
}),
),
attachments.length > 2
? Text(
"+${attachments.length - 2}",
style: TextStyle(
color: Theme.of(context).colorScheme.tertiary,
fontSize: 12,
)
],
)
: Container(),
SizedBox(
height:
i == 0 || allNotes[i].time != allNotes[i - 1].time
? 15
: 0),
Padding(
padding: EdgeInsets.all(8),
child: OpenContainer(
transitionDuration: Duration(milliseconds: 500),
closedColor: Color(0xff1B1B1B),
closedBuilder: (context, action) {
return Container(
// margin: EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: Color(0xff383838),
),
child: Padding(
padding: const EdgeInsets.all(20,),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"${allNotes[i].subject}: ${allNotes[i].title}",
style: Theme.of(context)
.textTheme
.titleMedium!
.copyWith(color: Colors.white),
),
const SizedBox(
height: 7,
),
Text(
/* use can use the
_getFirst5Words method here if want to
_getFirst5Words(widget.noteContent)
method on line no. 40
*/
allNotes[i].description,
// widget.noteContent,
style: Theme.of(context)
.textTheme
.titleSmall!
.copyWith(color: Colors.grey, fontSize: 14),
),
const SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
width:
MediaQuery.of(context).size.width *
.8,
height: 40,
child: ListView.builder(
scrollDirection: Axis.horizontal,
itemCount:
min(2, attachments.length),
itemBuilder: (context, ind) {
return CustomPdfIcon(
pdfName: attachments[ind],
);
}),
),
attachments.length > 2
? Text(
"+${attachments.length - 2}",
style: TextStyle(
color: Theme.of(context).colorScheme.tertiary,
fontSize: 12,
)
)
)
: Container()
],
),
],
: Container()
],
),
],
),
),
),
);
},
openBuilder: (context, action) {
return NotesModal(
action: action,
note: allNotes[i],
formKey: widget.formKey,
uploadNoteCallback: (List<String> selectedFiles,
List<String> deletedFiles,
List<String> originalFiles,
String? id,
String? title,
String? description,
String? subject,
String? branch,
String? division,
String? year) {
if (widget.formKey.currentState!.validate()) {
widget.uploadNoteCallback(
selectedFiles,
deletedFiles,
originalFiles,
id,
title,
description,
subject,
branch,
division,
year);
action.call();
}
},
);
},
);
},
openBuilder: (context, action) {
return NotesModal(
action: action,
note: allNotes[i],
formKey: widget.formKey,
uploadNoteCallback: (List<String> selectedFiles,
List<String> deletedFiles,
List<String> originalFiles,
String? id,
String? title,
String? description,
String? subject,
String? branch,
String? division,
String? year) {
if (widget.formKey.currentState!.validate()) {
widget.uploadNoteCallback(
selectedFiles,
deletedFiles,
originalFiles,
id,
title,
description,
subject,
branch,
division,
year);
action.call();
}
},
);
},
),
),
),
],
);
],
);
else {
return SizedBox();
}
},
),
)
Expand Down
Loading

0 comments on commit c2cf17d

Please sign in to comment.