add no notification message to drawer
This commit is contained in:
@@ -149,6 +149,35 @@ class _MIHNotificationDrawerState extends State<MIHNotificationDrawer> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget displayNotification() {
|
||||||
|
if (widget.notifications.isNotEmpty) {
|
||||||
|
return ListView.separated(
|
||||||
|
shrinkWrap: true,
|
||||||
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
|
separatorBuilder: (BuildContext context, index) {
|
||||||
|
return Divider(
|
||||||
|
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
itemCount: widget.notifications.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
//final patient = widget.patients[index].id_no.contains(widget.searchString);
|
||||||
|
//print(index);
|
||||||
|
return displayNotifications(index);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return const Padding(
|
||||||
|
padding: EdgeInsets.only(top: 35),
|
||||||
|
child: Text(
|
||||||
|
"No Notifications",
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(fontSize: 20),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
super.dispose();
|
super.dispose();
|
||||||
@@ -168,6 +197,7 @@ class _MIHNotificationDrawerState extends State<MIHNotificationDrawer> {
|
|||||||
//backgroundColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
//backgroundColor: MzanziInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
@@ -191,21 +221,22 @@ class _MIHNotificationDrawerState extends State<MIHNotificationDrawer> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
ListView.separated(
|
displayNotification(),
|
||||||
shrinkWrap: true,
|
// ListView.separated(
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
// shrinkWrap: true,
|
||||||
separatorBuilder: (BuildContext context, index) {
|
// physics: const NeverScrollableScrollPhysics(),
|
||||||
return Divider(
|
// separatorBuilder: (BuildContext context, index) {
|
||||||
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
// return Divider(
|
||||||
);
|
// color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
},
|
// );
|
||||||
itemCount: widget.notifications.length,
|
// },
|
||||||
itemBuilder: (context, index) {
|
// itemCount: widget.notifications.length,
|
||||||
//final patient = widget.patients[index].id_no.contains(widget.searchString);
|
// itemBuilder: (context, index) {
|
||||||
//print(index);
|
// //final patient = widget.patients[index].id_no.contains(widget.searchString);
|
||||||
return displayNotifications(index);
|
// //print(index);
|
||||||
},
|
// return displayNotifications(index);
|
||||||
),
|
// },
|
||||||
|
// ),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|||||||
Reference in New Issue
Block a user