Update dependencies and enhance tender approval status handling
- Updated `pubspec.lock` to reflect new versions for several packages, including `async`, `fake_async`, `leak_tracker`, and `vm_service`. - Modified `TenderApprovalStatus` enum to include a new status `approved`. - Updated routing for `YourTendersRouteData` to accept a status parameter and pass it to the `YourTendersScreen`. - Adjusted API calls and view models to utilize the new status handling, ensuring proper filtering and display of tender data based on approval status. - Enhanced filter dialog to support new status options and improved user feedback in the UI for submitted and approved tenders.
This commit is contained in:
@@ -3,7 +3,8 @@ enum TenderApprovalStatus {
|
||||
submitted,
|
||||
rejected,
|
||||
unsubmitted,
|
||||
unrejected;
|
||||
unrejected,
|
||||
approved;
|
||||
|
||||
/// Convert enum to string value for API
|
||||
String get value {
|
||||
@@ -16,6 +17,8 @@ enum TenderApprovalStatus {
|
||||
return 'unsubmitted';
|
||||
case TenderApprovalStatus.unrejected:
|
||||
return 'unrejected';
|
||||
case TenderApprovalStatus.approved:
|
||||
return 'approved';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,11 +212,12 @@ class NotificationRouteData extends GoRouteData with _$NotificationRouteData {
|
||||
|
||||
@TypedGoRoute<YourTendersRouteData>(path: '/your-tenders')
|
||||
class YourTendersRouteData extends GoRouteData with _$YourTendersRouteData {
|
||||
const YourTendersRouteData();
|
||||
final String status;
|
||||
const YourTendersRouteData({required this.status});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, GoRouterState state) {
|
||||
return yourTendersProvider(child: const YourTendersScreen());
|
||||
return yourTendersProvider(child: YourTendersScreen(status: status));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -247,10 +247,15 @@ RouteBase get $yourTendersRouteData => GoRouteData.$route(
|
||||
|
||||
mixin _$YourTendersRouteData on GoRouteData {
|
||||
static YourTendersRouteData _fromState(GoRouterState state) =>
|
||||
const YourTendersRouteData();
|
||||
YourTendersRouteData(status: state.uri.queryParameters['status']!);
|
||||
|
||||
YourTendersRouteData get _self => this as YourTendersRouteData;
|
||||
|
||||
@override
|
||||
String get location => GoRouteData.$location('/your-tenders');
|
||||
String get location => GoRouteData.$location(
|
||||
'/your-tenders',
|
||||
queryParams: {'status': _self.status},
|
||||
);
|
||||
|
||||
@override
|
||||
void go(BuildContext context) => context.go(location);
|
||||
|
||||
Reference in New Issue
Block a user