From 1901b84b2d194a81196afeec295fee5979909f94 Mon Sep 17 00:00:00 2001 From: llsajjad Date: Tue, 23 Sep 2025 16:07:44 +0330 Subject: [PATCH] Fixed CircularProgressIndicator color and position show in notification --- lib/data/services/notification_service.dart | 2 +- .../pages/d_notification_page.dart | 29 +++++++++++------ .../pages/m_notification_page.dart | 32 +++++++++++-------- .../pages/t_notification_page.dart | 29 +++++++++++------ 4 files changed, 60 insertions(+), 32 deletions(-) diff --git a/lib/data/services/notification_service.dart b/lib/data/services/notification_service.dart index 90f415a..45e0b25 100644 --- a/lib/data/services/notification_service.dart +++ b/lib/data/services/notification_service.dart @@ -43,7 +43,7 @@ class NotificationsService { method: 'POST', (json) => NotificationResponseModel.fromJson(json), data: data, - ); + ); return result; } diff --git a/lib/views/notification/pages/d_notification_page.dart b/lib/views/notification/pages/d_notification_page.dart index e1e6cf5..5e3417e 100644 --- a/lib/views/notification/pages/d_notification_page.dart +++ b/lib/views/notification/pages/d_notification_page.dart @@ -92,16 +92,27 @@ class _DesktopNotificationPageState extends State ), ), SizedBox(height: 12.0.h()), - Expanded( - child: TabBarView( - controller: controller, - children: const [ - NotificationAllTab(), - NotificationUnreadTab(), - NotificationImportantTab(), - ], + viewModel.isLoading + ? Container() + : Expanded( + child: TabBarView( + controller: controller, + children: const [ + NotificationAllTab(), + NotificationUnreadTab(), + NotificationImportantTab(), + ], + ), + ), + if (viewModel.isLoading) ...[ + const Spacer(), + const Center( + child: CircularProgressIndicator( + color: AppColors.secondary50, + ), ), - ), + const Spacer(), + ], SizedBox(height: 10.0.h()), Row( children: [ diff --git a/lib/views/notification/pages/m_notification_page.dart b/lib/views/notification/pages/m_notification_page.dart index 2256a26..2d0a879 100644 --- a/lib/views/notification/pages/m_notification_page.dart +++ b/lib/views/notification/pages/m_notification_page.dart @@ -98,20 +98,26 @@ class _MobileNotificationPageState extends State ), ), SizedBox(height: 12.0.h()), - Expanded( - child: TabBarView( - controller: controller, - children: [ - NotificationAllTab(scrollController: _scrollController), - NotificationUnreadTab(scrollController: _scrollController), - NotificationImportantTab(scrollController: _scrollController), - ], - ), - ), + viewModel.isLoading + ? Container() + : Expanded( + child: TabBarView( + controller: controller, + children: [ + NotificationAllTab(scrollController: _scrollController), + NotificationUnreadTab(scrollController: _scrollController), + NotificationImportantTab( + scrollController: _scrollController, + ), + ], + ), + ), if (viewModel.isLoading) ...[ - SizedBox(height: 10.0.h()), - const Center(child: CircularProgressIndicator()), - SizedBox(height: 10.0.h()), + const Spacer(), + const Center( + child: CircularProgressIndicator(color: AppColors.secondary50), + ), + const Spacer(), ], ], ), diff --git a/lib/views/notification/pages/t_notification_page.dart b/lib/views/notification/pages/t_notification_page.dart index dada67b..ce73d68 100644 --- a/lib/views/notification/pages/t_notification_page.dart +++ b/lib/views/notification/pages/t_notification_page.dart @@ -96,16 +96,27 @@ class _TabletNotificationPageState extends State ), ), SizedBox(height: 12.0.h()), - Expanded( - child: TabBarView( - controller: controller, - children: const [ - NotificationAllTab(), - NotificationUnreadTab(), - NotificationImportantTab(), - ], + viewModel.isLoading + ? Container() + : Expanded( + child: TabBarView( + controller: controller, + children: const [ + NotificationAllTab(), + NotificationUnreadTab(), + NotificationImportantTab(), + ], + ), + ), + if (viewModel.isLoading) ...[ + const Spacer(), + const Center( + child: CircularProgressIndicator( + color: AppColors.secondary50, + ), ), - ), + const Spacer(), + ], SizedBox(height: 10.0.h()), Row( children: [