diff --git a/lib/controllers/providers/api/all_requests_provider.dart b/lib/controllers/providers/api/all_requests_provider.dart index 61806a60..894d7089 100644 --- a/lib/controllers/providers/api/all_requests_provider.dart +++ b/lib/controllers/providers/api/all_requests_provider.dart @@ -727,6 +727,7 @@ class AllRequestsProvider extends ChangeNotifier { List? statusTransaction, List? priority, List? displayData, + bool? isAscending, }) async { if (isMultiFilterLoading == true) return -2; if (_allRequestsAndCount == null || pagination) { @@ -743,6 +744,7 @@ class AllRequestsProvider extends ChangeNotifier { body["pageNumber"] = pageNum++; body["pageSize"] = pageItemNumber; } + if (isAscending != null) body["isAscending"] = isAscending; response = await ApiManager.instance.post(URLs.getAllRequestsAndCount, body: body); stateCode = response.statusCode; diff --git a/lib/dashboard_latest/dashboard_provider.dart b/lib/dashboard_latest/dashboard_provider.dart index 90c651ae..c449f25d 100644 --- a/lib/dashboard_latest/dashboard_provider.dart +++ b/lib/dashboard_latest/dashboard_provider.dart @@ -347,6 +347,7 @@ class DashBoardProvider extends ChangeNotifier { statusTransaction: statusTransaction, priority: priority, displayData: displayData, + isAscending: isAscending, ); } diff --git a/lib/dashboard_latest/widgets/request_category_fragment.dart b/lib/dashboard_latest/widgets/request_category_fragment.dart index 472151c6..9798882b 100644 --- a/lib/dashboard_latest/widgets/request_category_fragment.dart +++ b/lib/dashboard_latest/widgets/request_category_fragment.dart @@ -79,10 +79,11 @@ class _RequestCategoryFragmentState extends State with // Reload data with new sort order dashboardProvider.resetRequestDataList(); + Provider.of(context, listen: false).reset(); if (dashboardProvider.listIndex.isEmpty) { - // No category selected - do nothing or could reload default - return; + // No category selected - reload default data with sorting + Provider.of(context, listen: false).getAllRequests(context, isAscending: isAscending); } else if (dashboardProvider.listIndex.length == 1 && dashboardProvider.isUnassignedTab(dashboardProvider.listIndex[0])) { // UnAssigned only - check by requestType, not by index int index = dashboardProvider.listIndex[0]; diff --git a/lib/views/widgets/dialogs/dialog.dart b/lib/views/widgets/dialogs/dialog.dart index 0cdfa87c..e7132eb1 100644 --- a/lib/views/widgets/dialogs/dialog.dart +++ b/lib/views/widgets/dialogs/dialog.dart @@ -37,6 +37,7 @@ class AAlertDialog extends StatelessWidget { ) : AlertDialog( backgroundColor: AppColor.background(context), + actionsPadding: const EdgeInsets.only(bottom: 12, left: 24, right: 24), title: title != null ? Text(title!) : null, content: content != null ? Text(content!) : null, // contentTextStyle: AppTextStyles.bodyText.copyWith(color: (context.isDark ? AppColor.neutral30 : AppColor.neutral50)),