Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Fourth Stepper and Fixed Filter in Notes #179

Merged
merged 5 commits into from
Jul 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading