Added unread list api in notification

This commit is contained in:
llsajjad
2025-09-23 15:49:30 +03:30
parent 70066c26e8
commit 1f60954c53
5 changed files with 86 additions and 22 deletions
@@ -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];