From 82a5af91703262ad76ba0eb0c34cf95a14e952d9 Mon Sep 17 00:00:00 2001 From: "Aamir.Muhammad" <> Date: Tue, 2 Jul 2024 15:59:00 +0300 Subject: [PATCH 1/3] User Profile API's & Image --- ios/Flutter/AppFrameworkInfo.plist | 2 +- lib/main.dart | 2 +- lib/views/dashboard/dashboard_page.dart | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist index 9625e10..7c56964 100644 --- a/ios/Flutter/AppFrameworkInfo.plist +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 11.0 + 12.0 diff --git a/lib/main.dart b/lib/main.dart index 1e261f8..b77fab5 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -51,7 +51,7 @@ Future main() async { ), ), ChangeNotifierProvider( - create: (_) => UserVM(userRepo: injector.get()), + create: (_) => UserVM(userRepo: injector.get(), commanServices: injector.get()), ), ChangeNotifierProvider( create: (_) => AdVM( diff --git a/lib/views/dashboard/dashboard_page.dart b/lib/views/dashboard/dashboard_page.dart index 2eb1ad0..ba6c010 100644 --- a/lib/views/dashboard/dashboard_page.dart +++ b/lib/views/dashboard/dashboard_page.dart @@ -135,7 +135,6 @@ class _DashboardPageState extends State { backgroundColor: null, leadingWidth: 100, title: getPageTitle(dashboardVM.selectedNavbarBarIndex), - profileImageUrl: MyAssets.bnCar, isRemoveBackButton: true, isDrawerEnabled: isHomePage ? true : false, onTap: () { From ea9c8ae34633ea4212059f5085d3435434fc96d6 Mon Sep 17 00:00:00 2001 From: "Aamir.Muhammad" <> Date: Thu, 11 Jul 2024 15:32:13 +0300 Subject: [PATCH 2/3] User Profile API's & Image --- ios/Runner.xcodeproj/project.pbxproj | 14 ++-- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- lib/views/dashboard/dashboard_page.dart | 11 ++-- .../dashboard/fragments/ads_fragment.dart | 6 +- .../fragments/appointments_fragment.dart | 5 +- .../fragments/branches_fragment.dart | 64 +++++++++++-------- .../dashboard/fragments/home_fragment.dart | 19 +++--- .../fragments/my_requests_fragment.dart | 5 +- .../dashboard/widgets/drawer_widget.dart | 10 +-- lib/views/provider/branch_detail_page.dart | 49 +++++++------- lib/views/provider/provider_profile_page.dart | 6 +- .../provider/sheet/items_list_sheet.dart | 13 ++-- pubspec.yaml | 2 +- 13 files changed, 115 insertions(+), 91 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index d193b7b..ecb319a 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -156,7 +156,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -360,7 +360,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -379,7 +379,7 @@ DEVELOPMENT_TEAM = 99Z3UD3LJM; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -439,7 +439,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -488,7 +488,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -509,7 +509,7 @@ DEVELOPMENT_TEAM = 99Z3UD3LJM; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -533,7 +533,7 @@ DEVELOPMENT_TEAM = 99Z3UD3LJM; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 3db53b6..e67b280 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ { String getPageTitle(int index) { if (index == 0) { - return "Branches"; + return LocaleKeys.branches.tr(); } if (index == 1) { - return "Appointments"; + return LocaleKeys.appointments.tr(); } if (index == 2) { return ""; } if (index == 3) { - return "Ads"; + return LocaleKeys.ads.tr(); } if (index == 4) { - return "My Requests"; + return LocaleKeys.myRequests.tr(); } return ""; } diff --git a/lib/views/dashboard/fragments/ads_fragment.dart b/lib/views/dashboard/fragments/ads_fragment.dart index c3f206e..b720614 100644 --- a/lib/views/dashboard/fragments/ads_fragment.dart +++ b/lib/views/dashboard/fragments/ads_fragment.dart @@ -4,6 +4,7 @@ import 'package:mc_common_app/config/dependencies.dart'; import 'package:mc_common_app/config/routes.dart'; import 'package:mc_common_app/extensions/int_extensions.dart'; import 'package:mc_common_app/extensions/string_extensions.dart'; +import 'package:mc_common_app/generated/locale_keys.g.dart'; import 'package:mc_common_app/models/advertisment_models/ad_details_model.dart'; import 'package:mc_common_app/theme/colors.dart'; import 'package:mc_common_app/utils/enums.dart'; @@ -14,6 +15,7 @@ import 'package:mc_common_app/widgets/button/show_fill_button.dart'; import 'package:mc_common_app/widgets/common_widgets/categories_list.dart'; import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; import 'package:provider/provider.dart'; +import 'package:easy_localization/easy_localization.dart'; class AdsFragment extends StatelessWidget { AdsFragment({Key? key}) : super(key: key); @@ -54,7 +56,7 @@ class AdsFragment extends StatelessWidget { child: ShowFillButton( isFilled: adVM.isExploreAdsTapped, maxHeight: 55, - title: "Explore Ads", + title: LocaleKeys.exploreAds.tr(), txtColor: adVM.isExploreAdsTapped ? MyColors.white : MyColors.darkTextColor, onPressed: () { print("ads: ${AppState().getUser.data!.accessToken}"); @@ -72,7 +74,7 @@ class AdsFragment extends StatelessWidget { isFilled: !adVM.isExploreAdsTapped, txtColor: !adVM.isExploreAdsTapped ? MyColors.white : MyColors.darkTextColor, maxHeight: 55, - title: "My Ads", + title: LocaleKeys.myAds.tr(), onPressed: () { adVM.updateIsExploreAds(false); }, diff --git a/lib/views/dashboard/fragments/appointments_fragment.dart b/lib/views/dashboard/fragments/appointments_fragment.dart index 7e545a8..7f9d903 100644 --- a/lib/views/dashboard/fragments/appointments_fragment.dart +++ b/lib/views/dashboard/fragments/appointments_fragment.dart @@ -1,4 +1,5 @@ +import 'package:mc_common_app/generated/locale_keys.g.dart'; import 'package:mc_common_app/view_models/appointments_view_model.dart'; import 'package:mc_common_app/view_models/dashboard_view_model_customer.dart'; import 'package:mc_common_app/views/appointments/widgets/customer_appointment_slider_widget.dart'; @@ -12,6 +13,8 @@ import 'package:mc_common_app/utils/enums.dart'; import 'package:mc_common_app/utils/navigator.dart'; import 'package:mc_common_app/widgets/common_widgets/categories_list.dart'; import 'package:provider/provider.dart'; +import 'package:easy_localization/easy_localization.dart'; + class AppointmentsFragment extends StatelessWidget { const AppointmentsFragment({Key? key}) : super(key: key); @@ -45,7 +48,7 @@ class AppointmentsFragment extends StatelessWidget { ? Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - "No Appointments to show.".toText(fontSize: 16, color: MyColors.lightTextColor), + LocaleKeys.noAppointmentstoShow.tr().toText(fontSize: 16, color: MyColors.lightTextColor), ], ) : ListView.builder( diff --git a/lib/views/dashboard/fragments/branches_fragment.dart b/lib/views/dashboard/fragments/branches_fragment.dart index 72a13c5..e7dd7a5 100644 --- a/lib/views/dashboard/fragments/branches_fragment.dart +++ b/lib/views/dashboard/fragments/branches_fragment.dart @@ -41,34 +41,44 @@ class BranchesFragment extends StatelessWidget { context.read().getAllNearBranches(isNeedToRebuild: true, isFromRefresh: true); }, child: Container( - width: double.infinity, - height: MediaQuery.of(context).size.height / 1.37, - child: appointmentsVM.state == ViewState.busy - ? const Center(child: CircularProgressIndicator()) - : appointmentsVM.nearbyBranches.isEmpty - ? Center(child: LocaleKeys.no_branch.tr().toText(fontSize: 16, color: MyColors.lightTextColor)) - : ListView.separated( - itemCount: appointmentsVM.nearbyBranches.length, - itemBuilder: (context, index) { - BranchDetailModel branchDetailModel = appointmentsVM.nearbyBranches[index]; + width: double.infinity, + height: MediaQuery.of(context).size.height / 1.37, + child: appointmentsVM.state == ViewState.busy + ? const Center( + child: CircularProgressIndicator(), + ) + : appointmentsVM.nearbyBranches.isEmpty + ? Center( + child: LocaleKeys.no_branch.tr().toText( + fontSize: 16, + color: MyColors.lightTextColor, + ), + ) + : ListView.separated( + itemCount: appointmentsVM.nearbyBranches.length, + itemBuilder: (context, index) { + BranchDetailModel branchDetailModel = appointmentsVM.nearbyBranches[index]; - return ProviderDetailsCard( - onCardTapped: () { - navigateWithName(context, AppRoutes.branchDetailPage, arguments: branchDetailModel); - }, - providerImageUrl: MyAssets.bnCar, - title: branchDetailModel.branchName ?? "", - providerLocation: branchDetailModel.distanceKm.toString() + " KM", - providerName: branchDetailModel.serviceProviderName ?? "", - providerRatings: "4.9", - services: branchDetailModel.branchServices, - ); - }, - separatorBuilder: (context, index) { - return 12.height; - }, - padding: const EdgeInsets.all(12), - )), + return ProviderDetailsCard( + onCardTapped: () { + navigateWithName(context, AppRoutes.branchDetailPage, arguments: branchDetailModel); + }, + providerImageUrl: MyAssets.bnCar, + title: branchDetailModel.branchName ?? "", + providerLocation: branchDetailModel.distanceKm.toString() + " KM", + providerName: branchDetailModel.serviceProviderName ?? "", + providerRatings: "4.9", + services: branchDetailModel.branchServices, + ); + }, + separatorBuilder: (context, index) { + return 12.height; + }, + padding: const EdgeInsets.all( + 12, + ), + ), + ), ), ), ], diff --git a/lib/views/dashboard/fragments/home_fragment.dart b/lib/views/dashboard/fragments/home_fragment.dart index 3dd22b4..e6e6098 100644 --- a/lib/views/dashboard/fragments/home_fragment.dart +++ b/lib/views/dashboard/fragments/home_fragment.dart @@ -1,6 +1,7 @@ import 'package:car_customer_app/views/dashboard/widgets/drawer_widget.dart'; import 'package:flutter/material.dart'; import 'package:mc_common_app/extensions/int_extensions.dart'; +import 'package:mc_common_app/generated/locale_keys.g.dart'; import 'package:mc_common_app/utils/enums.dart'; import 'package:mc_common_app/view_models/ad_view_model.dart'; import 'package:mc_common_app/view_models/appointments_view_model.dart'; @@ -11,6 +12,8 @@ import 'package:mc_common_app/widgets/common_widgets/my_service_provider.dart'; import 'package:mc_common_app/widgets/common_widgets/view_all_widget.dart'; import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; import 'package:provider/provider.dart'; +import 'package:easy_localization/easy_localization.dart'; + class HomeFragment extends StatelessWidget { const HomeFragment({Key? key}) : super(key: key); @@ -30,8 +33,8 @@ class HomeFragment extends StatelessWidget { children: [ 16.height, ViewAllWidget( - title: "Upcoming Appointment".toUpperCase(), - subTitle: "View All", + title: LocaleKeys.upcoming_appointment.tr().toUpperCase(), + subTitle: LocaleKeys.view_all.tr(), onSubtitleTapped: () { context.read().onNavbarTapped(1); context.read().applyFilterOnAppointmentsVM(appointmentStatusEnum: AppointmentStatusEnum.allAppointments); @@ -40,8 +43,8 @@ class HomeFragment extends StatelessWidget { CustomerAppointmentSliderWidget(myUpComingAppointments: context.read().myUpComingAppointments), 7.height, ViewAllWidget( - title: "My Recent Service Providers".toUpperCase(), - subTitle: "View All", + title: LocaleKeys.my_recent_providers.tr().toUpperCase(), + subTitle: LocaleKeys.view_all.tr(), onSubtitleTapped: () { context.read().onNavbarTapped(0); context.read().applyFilterOnBranches(index: 0); @@ -58,8 +61,8 @@ class HomeFragment extends StatelessWidget { children: [ 15.height, ViewAllWidget( - title: "My Active Ads".toUpperCase(), - subTitle: "View All", + title: LocaleKeys.my_active_Ads.tr().toUpperCase(), + subTitle: LocaleKeys.view_all.tr(), onSubtitleTapped: () { context.read().onNavbarTapped(3); context.read().updateIsExploreAds(false); @@ -78,8 +81,8 @@ class HomeFragment extends StatelessWidget { children: [ 15.height, ViewAllWidget( - title: "My Recommended Ads".toUpperCase(), - subTitle: "View All", + title: LocaleKeys.myRecommendedAds.tr().toUpperCase(), + subTitle: LocaleKeys.view_all.tr(), onSubtitleTapped: () { context.read().onNavbarTapped(3); context.read().updateIsExploreAds(true); diff --git a/lib/views/dashboard/fragments/my_requests_fragment.dart b/lib/views/dashboard/fragments/my_requests_fragment.dart index d05cdc4..3ce18db 100644 --- a/lib/views/dashboard/fragments/my_requests_fragment.dart +++ b/lib/views/dashboard/fragments/my_requests_fragment.dart @@ -1,3 +1,4 @@ +import 'package:mc_common_app/generated/locale_keys.g.dart'; import 'package:mc_common_app/view_models/requests_view_model.dart'; import 'package:flutter/material.dart'; import 'package:mc_common_app/config/routes.dart'; @@ -9,6 +10,8 @@ import 'package:mc_common_app/utils/navigator.dart'; import 'package:mc_common_app/views/requests/widget/request_item.dart'; import 'package:mc_common_app/widgets/common_widgets/categories_list.dart'; import 'package:provider/provider.dart'; +import 'package:easy_localization/easy_localization.dart'; + class MyRequestsFragment extends StatelessWidget { const MyRequestsFragment({super.key}); @@ -40,7 +43,7 @@ class MyRequestsFragment extends StatelessWidget { ? Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - "No Requests to show.".toText(fontSize: 16, color: MyColors.lightTextColor), + LocaleKeys.noRequeststoShow.tr().toText(fontSize: 16, color: MyColors.lightTextColor), ], ) : ListView.separated( diff --git a/lib/views/dashboard/widgets/drawer_widget.dart b/lib/views/dashboard/widgets/drawer_widget.dart index f29082a..3e21447 100644 --- a/lib/views/dashboard/widgets/drawer_widget.dart +++ b/lib/views/dashboard/widgets/drawer_widget.dart @@ -29,10 +29,10 @@ class _CustomDrawerState extends State { showDialog( context: context, builder: (context) => AlertDialog( - content: const Text("Choose image source"), + content: Text(LocaleKeys.chooseImageSource.tr()), actions: [ - TextButton(child: const Text("Camera"), onPressed: () => widget.dashboardVM.pickImageFromPhone(context, 0)), - TextButton(child: const Text("Gallery"), onPressed: () => widget.dashboardVM.pickImageFromPhone(context, 1)), + TextButton(child: Text(LocaleKeys.camera.tr()), onPressed: () => widget.dashboardVM.pickImageFromPhone(context, 0)), + TextButton(child: Text(LocaleKeys.gallery.tr()), onPressed: () => widget.dashboardVM.pickImageFromPhone(context, 1)), ], ), ); @@ -92,7 +92,7 @@ class _CustomDrawerState extends State { Utils.showLoading(context); ImageResponse response = await widget.dashboardVM.updateUserImage(""); if (response.messageStatus == 1) { - Utils.showToast("Image is Deleted"); + Utils.showToast(LocaleKeys.imageIsDeleted.tr()); setState(() { AppState().getUser.data!.userInfo!.userImageUrl = response.data; }); @@ -118,7 +118,7 @@ class _CustomDrawerState extends State { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - "userName".toText( + LocaleKeys.profile_reset_password_username.toText( isBold: true, fontSize: 20, letterSpacing: -1.44, diff --git a/lib/views/provider/branch_detail_page.dart b/lib/views/provider/branch_detail_page.dart index 338e7ec..272c9a1 100644 --- a/lib/views/provider/branch_detail_page.dart +++ b/lib/views/provider/branch_detail_page.dart @@ -37,7 +37,7 @@ class _BranchDetailPageState extends State { Widget build(BuildContext context) { return Scaffold( appBar: CustomAppBar( - title: "Branch Detail", + title: LocaleKeys.branchDetail.tr(), onBackButtonTapped: () { context.read().resetCategorySelectionBottomSheet(); Navigator.pop(context); @@ -70,7 +70,7 @@ class _BranchDetailPageState extends State { ), Row( children: [ - ("Time" + ":").toText(color: MyColors.lightTextColor, fontSize: 12), + (LocaleKeys.time.tr() + ":").toText(color: MyColors.lightTextColor, fontSize: 12), 4.width, "${widget.branchDetailModel.openTime} - ${widget.branchDetailModel.closeTime}".toText(fontSize: 12, isBold: true), ], @@ -83,13 +83,12 @@ class _BranchDetailPageState extends State { mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ - //TODO: Needs to implement url launcher - "Open Map Location".toText( - fontSize: 12, - isBold: true, - color: MyColors.primaryColor, - isUnderLine: true, - ), + LocaleKeys.openMapLocation.tr().toText( + fontSize: 12, + isBold: true, + color: MyColors.primaryColor, + isUnderLine: true, + ), 4.width, Image.asset( MyAssets.icRightUpPng, @@ -103,12 +102,12 @@ class _BranchDetailPageState extends State { mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ - "Provider Profile".toText( - fontSize: 12, - isBold: true, - color: MyColors.primaryColor, - isUnderLine: true, - ), + LocaleKeys.providerProfile.tr().toText( + fontSize: 12, + isBold: true, + color: MyColors.primaryColor, + isUnderLine: true, + ), 2.width, Icon( Icons.arrow_forward, @@ -122,12 +121,12 @@ class _BranchDetailPageState extends State { ], ), 20.height, - "Services Offer".toText( - fontSize: 16, - color: MyColors.lightTextColor, - isBold: true, - ), - if (widget.branchDetailModel.branchServices!.length == 0) "No Services Available".toText(fontSize: 12, isBold: true), + LocaleKeys.servicesOffer.tr().toText( + fontSize: 16, + color: MyColors.lightTextColor, + isBold: true, + ), + if (widget.branchDetailModel.branchServices!.length == 0) LocaleKeys.noServicesAvailable.tr().toText(fontSize: 12, isBold: true), showServicesList(), ], ).toWhiteContainer( @@ -140,7 +139,7 @@ class _BranchDetailPageState extends State { ), ), ShowFillButton( - title: "Book Appointment", + title: LocaleKeys.bookAppointment.tr(), maxWidth: double.infinity, margin: EdgeInsets.all(21), onPressed: () { @@ -166,9 +165,9 @@ class _BranchDetailPageState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - showItem("Allowing home service:", (widget.branchDetailModel.branchServices![index].isAllowAppointment ?? false) ? "Yes" : "No", valueColor: Colors.green), - showItem("Home service range", widget.branchDetailModel.branchServices![index].customerLocationRange.toString() + "KM"), - showItem("Charges per KM", widget.branchDetailModel.branchServices![index].customerLocationRange.toString() + "SAR"), + showItem(LocaleKeys.allowingHomeService.tr() + " :", (widget.branchDetailModel.branchServices![index].isAllowAppointment ?? false) ? "Yes" : "No", valueColor: Colors.green), + showItem(LocaleKeys.homeServiceRange.tr() + " :", widget.branchDetailModel.branchServices![index].customerLocationRange.toString() + "KM"), + showItem(LocaleKeys.chargesPerKM.tr() + " :", widget.branchDetailModel.branchServices![index].customerLocationRange.toString() + LocaleKeys.sar.tr()), 8.height, ((widget.branchDetailModel.branchServices![index].itemsCount != null && widget.branchDetailModel.branchServices![index].itemsCount! > 0) ? widget.branchDetailModel.branchServices![index].itemsCount.toString() + " items" diff --git a/lib/views/provider/provider_profile_page.dart b/lib/views/provider/provider_profile_page.dart index 7c029da..3ab5956 100644 --- a/lib/views/provider/provider_profile_page.dart +++ b/lib/views/provider/provider_profile_page.dart @@ -34,7 +34,7 @@ class _ProviderProfilePageState extends State { Widget build(BuildContext context) { return Scaffold( appBar: CustomAppBar( - title: "Provider Details", + title: LocaleKeys.providerDetails.tr(), ), body: Container( width: double.infinity, @@ -70,7 +70,7 @@ class _ProviderProfilePageState extends State { 4.height, //TODO: company description not added form provider app yet // model.providerModel!.data!.companyDescription!.toText(color: MyColors.lightTextColor, fontSize: 12), - "Some description about the provider and their years of experience and their reputation".toText(color: MyColors.lightTextColor, fontSize: 12), + LocaleKeys.someDescriptionExperienceandtheirReputation.tr().toText(color: MyColors.lightTextColor, fontSize: 12), ], ).toWhiteContainer( width: double.infinity, @@ -78,7 +78,7 @@ class _ProviderProfilePageState extends State { ), 12.height, model.providerProfileModel!.serviceProviderBranch == null - ? const Center(child: Text("No Branch Found")) + ? Center(child: Text(LocaleKeys.noBranchFound)) : model.providerProfileModel!.serviceProviderBranch!.isEmpty ? Center(child: Text(LocaleKeys.no_branch.tr())) : ListView.separated( diff --git a/lib/views/provider/sheet/items_list_sheet.dart b/lib/views/provider/sheet/items_list_sheet.dart index 57ffc11..29bf95b 100644 --- a/lib/views/provider/sheet/items_list_sheet.dart +++ b/lib/views/provider/sheet/items_list_sheet.dart @@ -1,3 +1,4 @@ +import 'package:mc_common_app/generated/locale_keys.g.dart'; import 'package:mc_common_app/models/services_models/item_model.dart'; import 'package:mc_common_app/view_models/appointments_view_model.dart'; import 'package:flutter/material.dart'; @@ -7,6 +8,8 @@ import 'package:mc_common_app/theme/colors.dart'; import 'package:mc_common_app/widgets/empty_widget.dart'; import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; import 'package:provider/provider.dart'; +import 'package:easy_localization/easy_localization.dart'; + class ItemsListSheet extends StatefulWidget { final int serviceId; @@ -49,11 +52,11 @@ class _ItemsListSheetState extends State { children: [ serviceItemModel.name.toString().toText(fontSize: 16, isBold: true), 4.height, - showItem("Available for appointment:", (serviceItemModel.isAllowAppointment ?? false) ? "Yes" : "No", valueColor: Colors.green), - showItem("Allowing Workshop service:", (serviceItemModel.isAppointmentCompanyLoc ?? false) ? "Yes" : "No", valueColor: Colors.green), - showItem("Allowing home service:", (serviceItemModel.isAppointmentCustomerLoc ?? false) ? "Yes" : "No", valueColor: Colors.green), + showItem(LocaleKeys.availableforAppointment.tr() + ":", (serviceItemModel.isAllowAppointment ?? false) ? "Yes" : "No", valueColor: Colors.green), + showItem(LocaleKeys.allowingWorkshopService.tr() + ":", (serviceItemModel.isAppointmentCompanyLoc ?? false) ? "Yes" : "No", valueColor: Colors.green), + showItem(LocaleKeys.allowingHomeService.tr() + ":", (serviceItemModel.isAppointmentCustomerLoc ?? false) ? "Yes" : "No", valueColor: Colors.green), 12.height, - "Service Amount".toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true), + LocaleKeys.serviceAmount.tr().toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true), Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ @@ -61,7 +64,7 @@ class _ItemsListSheetState extends State { 2.width, Padding( padding: const EdgeInsets.only(bottom: 4), - child: "SAR".toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true), + child: LocaleKeys.sar.tr().toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true), ), ], ), diff --git a/pubspec.yaml b/pubspec.yaml index a7d4453..cd455aa 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -36,7 +36,7 @@ dependencies: cupertino_icons: ^1.0.2 mc_common_app: - path: /Volumes/Data/Projects/Flutter/car_common_app + path: /Users/amir/StudioProjects/car_common_app dev_dependencies: flutter_test: From 6ed7e2fa3dc9db5bb0033e0c99910eb74ffc33c9 Mon Sep 17 00:00:00 2001 From: "Aamir.Muhammad" <> Date: Wed, 17 Jul 2024 11:28:56 +0300 Subject: [PATCH 3/3] dashbord skip --- lib/views/dashboard/dashboard_page.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/views/dashboard/dashboard_page.dart b/lib/views/dashboard/dashboard_page.dart index bd6d009..4c227cc 100644 --- a/lib/views/dashboard/dashboard_page.dart +++ b/lib/views/dashboard/dashboard_page.dart @@ -129,8 +129,8 @@ class _DashboardPageState extends State { Widget build(BuildContext context) { DashboardVmCustomer dashboardVM = context.read(); bool isHomePage = dashboardVM.selectedNavbarBarIndex == 2; - return WillPopScope( - onWillPop: () async => Future.value(false), + return PopScope( + canPop: false, child: Scaffold( appBar: CustomAppBar( backgroundColor: null,