Refactor tenders pagination and enhance API integration
- Updated TendersRepository and TendersService to support cursor-based pagination. - Modified TendersViewModel to manage pagination state and handle API responses more effectively. - Replaced existing pagination UI components with a new WindowedPagination widget across desktop, mobile, and tablet views. - Improved notification handling in the UI to reflect the presence of notifications dynamically. - Adjusted main tenders slider to ensure proper rendering based on the current page index.
This commit is contained in:
@@ -101,29 +101,40 @@ class _MobileNotificationPageState extends State<MobileNotificationPage>
|
||||
padding: EdgeInsetsDirectional.only(end: 24.0.w()),
|
||||
child: Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
viewModel.markAllAsRead(context);
|
||||
},
|
||||
borderRadius: BorderRadius.circular(99),
|
||||
child: Container(
|
||||
width: 132.0.w(),
|
||||
height: 32.0.h(),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.primary20,
|
||||
child: Builder(
|
||||
builder: (context) {
|
||||
final hasNotifications =
|
||||
(viewModel.allNotificationResponse?.data?.isNotEmpty ??
|
||||
false);
|
||||
return InkWell(
|
||||
onTap: hasNotifications
|
||||
? () => viewModel.markAllAsRead(context)
|
||||
: null,
|
||||
borderRadius: BorderRadius.circular(99),
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
NotificationStrings.markAllAsReadButton,
|
||||
style: TextStyle(
|
||||
fontSize: 14.0.sp(),
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColors.mainBlue,
|
||||
child: Container(
|
||||
width: 132.0.w(),
|
||||
height: 32.0.h(),
|
||||
decoration: BoxDecoration(
|
||||
color: hasNotifications
|
||||
? AppColors.primary20
|
||||
: AppColors.grey20,
|
||||
borderRadius: BorderRadius.circular(99),
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
NotificationStrings.markAllAsReadButton,
|
||||
style: TextStyle(
|
||||
fontSize: 14.0.sp(),
|
||||
fontWeight: FontWeight.w500,
|
||||
color: hasNotifications
|
||||
? AppColors.mainBlue
|
||||
: AppColors.grey50,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user