Added unread list api in notification
This commit is contained in:
@@ -12,9 +12,20 @@ class NotificationUnreadTab extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final viewModel = context.watch<NotificationViewModel>();
|
||||
|
||||
if (viewModel.isUnreadLoading) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
|
||||
final notifications =
|
||||
viewModel.notificationResponse?.data?.notifications ?? [];
|
||||
viewModel.unreadNotificationResponse?.data?.notifications ?? [];
|
||||
|
||||
if (notifications.isEmpty) {
|
||||
return const Center(child: Text('No unread notifications'));
|
||||
}
|
||||
|
||||
return ListView.builder(
|
||||
controller: scrollController,
|
||||
itemCount: notifications.length,
|
||||
itemBuilder: (context, index) {
|
||||
final notification = notifications[index];
|
||||
|
||||
Reference in New Issue
Block a user