Notification Screen and tasq_adaptive_list enhancements
This commit is contained in:
@@ -76,6 +76,21 @@ class _NotificationBridgeState extends ConsumerState<NotificationBridge>
|
||||
}
|
||||
}
|
||||
|
||||
String _bannerLabel(String type) => switch (type) {
|
||||
'mention' => 'New mention',
|
||||
'assignment' => 'New assignment',
|
||||
'created' => 'New item created',
|
||||
'announcement' => 'New announcement',
|
||||
'announcement_comment' => 'New announcement comment',
|
||||
'swap_request' => 'New shift swap request',
|
||||
'swap_update' => 'Shift swap updated',
|
||||
'it_job_reminder' => 'IT Job reminder',
|
||||
'isr_approved' => 'IT Service Request approved',
|
||||
'isr_status_changed' => 'IT Service Request updated',
|
||||
'isr_assigned' => 'New IT Service Request assigned',
|
||||
_ => 'New notification',
|
||||
};
|
||||
|
||||
void _showBanner(String type, NotificationItem item) {
|
||||
// Use a post-frame callback so that the ScaffoldMessenger from
|
||||
// MaterialApp is available in the element tree.
|
||||
@@ -84,7 +99,7 @@ class _NotificationBridgeState extends ConsumerState<NotificationBridge>
|
||||
try {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text('New $type received!'),
|
||||
content: Text(_bannerLabel(type)),
|
||||
action: SnackBarAction(
|
||||
label: 'View',
|
||||
onPressed: () =>
|
||||
|
||||
Reference in New Issue
Block a user