From e2de4765819d5c7aa18ee500af4e5befa26fd446 Mon Sep 17 00:00:00 2001 From: Faiz Hashmi Date: Wed, 8 May 2024 18:10:47 +0300 Subject: [PATCH] Added Branch FilterView --- .gitignore | 2 ++ lib/config/customer_routes.dart | 7 ++++--- lib/main.dart | 2 ++ lib/views/dashboard/dashboard_page.dart | 26 +++++++++++++++---------- pubspec.yaml | 2 +- 5 files changed, 25 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 0fa6b67..51dab37 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,5 @@ app.*.map.json /android/app/debug /android/app/profile /android/app/release + +pubspec.lock diff --git a/lib/config/customer_routes.dart b/lib/config/customer_routes.dart index 7411547..99044e1 100644 --- a/lib/config/customer_routes.dart +++ b/lib/config/customer_routes.dart @@ -24,6 +24,7 @@ import 'package:mc_common_app/views/setting_options/setting_options_faqs.dart'; import 'package:mc_common_app/views/setting_options/setting_options_invite_friends.dart'; import 'package:mc_common_app/views/setting_options/setting_options_language.dart'; import 'package:mc_common_app/views/chat/chat_view.dart'; +import 'package:mc_common_app/views/branches/branches_filter_view.dart'; class CustomerAppRoutes { static final Map routes = { @@ -35,13 +36,13 @@ class CustomerAppRoutes { AppRoutes.adsFilterView: (context) => AdsFilterView(), AppRoutes.selectAdTypeView: (context) => SelectAdTypeView(isProvider: ModalRoute.of(context)!.settings.arguments as bool), AppRoutes.bookAppointmenServicesView: (context) => BookAppointmentServicesView(), - AppRoutes.bookAppointmenSchedulesView: (context) => BookAppointmentSchedulesView( - screenArgumentsForAppointmentDetailPage: ModalRoute.of(context)!.settings.arguments as ScreenArgumentsForAppointmentDetailPage, - ), + AppRoutes.bookAppointmenSchedulesView: (context) => + BookAppointmentSchedulesView(screenArgumentsForAppointmentDetailPage: ModalRoute.of(context)!.settings.arguments as ScreenArgumentsForAppointmentDetailPage), AppRoutes.bookAppointmentsItemView: (context) => BookAppointmentsItemView(), AppRoutes.reviewAppointmentView: (context) => ReviewAppointment(), AppRoutes.paymentMethodsView: (context) => PaymentMethodsView(paymentType: ModalRoute.of(context)!.settings.arguments as PaymentTypes), AppRoutes.branchDetailPage: (context) => BranchDetailPage(branchDetailModel: ModalRoute.of(context)!.settings.arguments as BranchDetailModel), + AppRoutes.branchSearchFilterPage: (context) => BranchesFilterView(), AppRoutes.providerProfilePage: (context) => ProviderProfilePage(providerId: ModalRoute.of(context)!.settings.arguments as int), AppRoutes.offersListPage: (context) => OfferListPage(offerListPageArguments: ModalRoute.of(context)!.settings.arguments as OfferListPageArguments), AppRoutes.createRequestPage: (context) => CreateRequestPage(), diff --git a/lib/main.dart b/lib/main.dart index b05de48..80c46dd 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,5 +1,6 @@ import 'package:car_customer_app/config/customer_dependencies.dart'; import 'package:car_customer_app/config/customer_routes.dart'; +import 'package:mc_common_app/repositories/branch_repo.dart'; import 'package:mc_common_app/repositories/chat_repo.dart'; import 'package:mc_common_app/repositories/provider_repo.dart'; import 'package:mc_common_app/repositories/appointment_repo.dart'; @@ -66,6 +67,7 @@ Future main() async { providerRepo: injector.get(), commonServices: injector.get(), commonRepo: injector.get(), + branchRepo: injector.get(), ), ), ChangeNotifierProvider( diff --git a/lib/views/dashboard/dashboard_page.dart b/lib/views/dashboard/dashboard_page.dart index 55a3ba8..bdefaf8 100644 --- a/lib/views/dashboard/dashboard_page.dart +++ b/lib/views/dashboard/dashboard_page.dart @@ -136,19 +136,21 @@ class _DashboardPageState extends State { (isHomePage ? Row( children: [ - "${AppState().currentAppType}".toText(color: MyColors.darkTextColor).onPress(() { - print("myId: ${AppState().getUser.data!.userInfo!.userId}"); - print("myId: ${AppState().getUser.data!.userInfo!.customerId}"); - // context.read().buildHubConnection(); - }), + "${AppState().currentAppType}".toText(color: MyColors.darkTextColor).onPress( + () { + print("userId: ${AppState().getUser.data!.userInfo!.userId}"); + print("customerId: ${AppState().getUser.data!.userInfo!.customerId}"); + // context.read().buildHubConnection(); + }, + ), 10.width, MyAssets.notificationsBellIcon.buildSvg().onPress(() {}), 15.width, - Icon(Icons.message, color: MyColors.darkTextColor).onPress(() { - context.read().populateAppointmentsFilterList(); - - _onRefresh(); - }), + Icon(Icons.message, color: MyColors.darkTextColor).onPress( + () { + _onRefresh(); + }, + ), ], ) : InkWell( @@ -157,6 +159,10 @@ class _DashboardPageState extends State { await context.read().populateDataForAdFilter(); navigateWithName(context, AppRoutes.adsFilterView); } + if (dashboardVM.selectedNavbarBarIndex == 0) { + await context.read().populateDataForBranchesFilter(); + navigateWithName(context, AppRoutes.branchSearchFilterPage); + } }, child: MyAssets.searchIcon.buildSvg(), )) diff --git a/pubspec.yaml b/pubspec.yaml index 9f57ab6..a7d4453 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -36,7 +36,7 @@ dependencies: cupertino_icons: ^1.0.2 mc_common_app: - path: C:/Users/mirza.shafique/AndroidStudioProjects/mc_common_app + path: /Volumes/Data/Projects/Flutter/car_common_app dev_dependencies: flutter_test: