diff --git a/assets/fonts/GESS-Two-Bold.otf b/assets/fonts/GESS-Two-Bold.otf new file mode 100644 index 0000000..da99274 Binary files /dev/null and b/assets/fonts/GESS-Two-Bold.otf differ diff --git a/assets/fonts/GESS-Two-Light.otf b/assets/fonts/GESS-Two-Light.otf new file mode 100644 index 0000000..60ea874 Binary files /dev/null and b/assets/fonts/GESS-Two-Light.otf differ diff --git a/assets/fonts/GESS-Two-Medium.otf b/assets/fonts/GESS-Two-Medium.otf new file mode 100644 index 0000000..ff4a1bf Binary files /dev/null and b/assets/fonts/GESS-Two-Medium.otf differ diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index b6262f6..65ecac1 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -566,7 +566,8 @@ "defineLicenses": "تحديد التراخيص", "logOut": "تسجيل الخروج", "customer": "العميل", - "accept": "قبول" + "accept": "قبول", + "amountVAR": "كمية" diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index ea99de6..a3f396e 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -567,5 +567,6 @@ "defineLicenses": "Define Licenses", "logOut": "Log Out", "customer": "Customer", - "accept": "Accept" + "accept": "Accept", + "amountVAR": "Amount" } \ No newline at end of file diff --git a/lib/classes/app_state.dart b/lib/classes/app_state.dart index 1379646..89e75de 100644 --- a/lib/classes/app_state.dart +++ b/lib/classes/app_state.dart @@ -1,5 +1,6 @@ import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:mc_common_app/models/general_models/post_params_model.dart'; +import 'package:mc_common_app/models/subscriptions_models/provider_subscription_model.dart'; import 'package:mc_common_app/models/user_models/user.dart'; import 'package:mc_common_app/utils/enums.dart'; @@ -44,4 +45,12 @@ class AppState { set setCurrentLocation(v) => currentLocation = v; LatLng get getCurrentLocation => currentLocation; + + List? _providerSubscription; + + List get getproviderSubscription => _providerSubscription!; + + set setproviderSubscription(List value) { + _providerSubscription = value; + } } diff --git a/lib/classes/consts.dart b/lib/classes/consts.dart index b5ea4a0..6a2a963 100644 --- a/lib/classes/consts.dart +++ b/lib/classes/consts.dart @@ -291,4 +291,5 @@ class MyLocales { class MyFonts { static const poppinsFont = "packages/mc_common_app/Poppins"; + static const gessTwoFont = "packages/mc_common_app/GessTwo"; } diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index 8f4e664..d893157 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -582,7 +582,8 @@ class CodegenLoader extends AssetLoader{ "defineLicenses": "تحديد التراخيص", "logOut": "تسجيل الخروج", "customer": "العميل", - "accept": "قبول" + "accept": "قبول", + "amountVAR": "كمية" }; static const Map en_US = { "firstTimeLogIn": "First Time Log In", @@ -1153,7 +1154,8 @@ static const Map en_US = { "defineLicenses": "Define Licenses", "logOut": "Log Out", "customer": "Customer", - "accept": "Accept" + "accept": "Accept", + "amountVAR": "Amount" }; static const Map> mapLocales = {"ar_SA": ar_SA, "en_US": en_US}; } diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 355108c..e854db3 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -546,5 +546,6 @@ abstract class LocaleKeys { static const logOut = 'logOut'; static const customer = 'customer'; static const accept = 'accept'; + static const amountVAR = 'amountVAR'; } diff --git a/lib/theme/app_theme.dart b/lib/theme/app_theme.dart index 1fa9447..72b40fb 100644 --- a/lib/theme/app_theme.dart +++ b/lib/theme/app_theme.dart @@ -5,14 +5,14 @@ import 'colors.dart'; class AppTheme { static getTheme({required isArabic}) { - return ThemeData( - fontFamily: !isArabic ? MyFonts.poppinsFont : null, + fontFamily: !isArabic ? MyFonts.poppinsFont : MyFonts.gessTwoFont, primaryColor: primaryColor, useMaterial3: false, primaryTextTheme: const TextTheme( titleLarge: TextStyle(color: Colors.white), - ), colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.orange).copyWith(background: Colors.white), + ), + colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.orange).copyWith(background: Colors.white), ); } } diff --git a/lib/view_models/appointments_view_model.dart b/lib/view_models/appointments_view_model.dart index 4e8d64c..e14683c 100644 --- a/lib/view_models/appointments_view_model.dart +++ b/lib/view_models/appointments_view_model.dart @@ -359,7 +359,7 @@ class AppointmentsVM extends BaseVM { myAppointments = await appointmentRepo.getMyAppointmentsForCustomersByFilters(); // myFilteredAppointments = myAppointments; - myUpComingAppointments = myAppointments.where((element) => element.appointmentStatusEnum == AppointmentStatusEnum.booked).toList(); + myUpComingAppointments = myAppointments.where((element) => element.appointmentStatusEnum == AppointmentStatusEnum.booked || element.appointmentStatusEnum == AppointmentStatusEnum.confirmed ).toList(); setState(ViewState.idle); applyFilterOnAppointmentsVM(appointmentStatusEnum: AppointmentStatusEnum.allAppointments); notifyListeners(); diff --git a/lib/view_models/subscriptions_view_model.dart b/lib/view_models/subscriptions_view_model.dart index 546ed13..5f1ac44 100644 --- a/lib/view_models/subscriptions_view_model.dart +++ b/lib/view_models/subscriptions_view_model.dart @@ -178,6 +178,7 @@ class SubscriptionsVM extends BaseVM { setState(ViewState.busy); if (mySubscriptionsBySp.isEmpty) { mySubscriptionsBySp = await subscriptionRepo.getProviderSubscription(serviceProviderID: serviceProviderID); + AppState().setproviderSubscription = mySubscriptionsBySp; } setState(ViewState.idle); } diff --git a/lib/view_models/user_view_model.dart b/lib/view_models/user_view_model.dart index 34b65f2..dcc2351 100644 --- a/lib/view_models/user_view_model.dart +++ b/lib/view_models/user_view_model.dart @@ -163,7 +163,8 @@ class UserVM extends BaseVM { } } - Future performCompleteProfile(BuildContext context, { + Future performCompleteProfile( + BuildContext context, { required String password, required String confirmPassword, required String firstName, @@ -350,7 +351,7 @@ class UserVM extends BaseVM { Future performBasicOtpLoginSelectionPage(BuildContext context, {required String userToken, required AppType appType, String? loginType}) async { if (loginType == "3" || loginType == "4") { - //Utils.showLoading(context); + //Utils.showLoading(context); LoginPasswordRespModel user = await userRepo.loginV2OTP(userToken, loginType!); if (user.messageStatus == 1) { Response response2 = await userRepo.loginV2OTPVerify(user.data!.userToken ?? "", "9999"); @@ -377,17 +378,17 @@ class UserVM extends BaseVM { SharedPrefManager.setData(jsonEncode(user.data!.userInfo!.toJson())); navigateReplaceWithName(context, AppRoutes.dashboard); } else { - Utils.showToast(LocaleKeys.onlyCustomerApp.tr()); + Utils.showToast(LocaleKeys.onlyCustomerApp.tr()); } } } else { - Utils.showToast(verifiedUser.message ?? ""); + Utils.showToast(verifiedUser.message ?? ""); } } } else { - // Utils.showLoading(context); + // Utils.showLoading(context); LoginPasswordRespModel user = await userRepo.loginV2OTP(userToken, "1"); - // Utils.hideLoading(context); + // Utils.hideLoading(context); if (user.messageStatus == 1) { showMDialog(context, child: OtpDialog( onClick: (String code) async { @@ -518,8 +519,8 @@ class UserVM extends BaseVM { type == ClassType.NUMBER && countryCode != null ? countryCode + phoneNum : type == ClassType.NUMBER && countryCode == null - ? phoneNum - : phoneNum, + ? phoneNum + : phoneNum, password); Utils.hideLoading(context); LoginPasswordRespModel user = LoginPasswordRespModel.fromJson(jsonDecode(response.body)); @@ -527,8 +528,8 @@ class UserVM extends BaseVM { SharedPrefManager.setPhoneOrEmail(type == ClassType.NUMBER && countryCode != null ? countryCode + phoneNum : type == ClassType.NUMBER && countryCode == null - ? phoneNum - : phoneNum); + ? phoneNum + : phoneNum); SharedPrefManager.setUserPassword(password); navigateReplaceWithName(context, AppRoutes.loginMethodSelection, arguments: user.data!.userToken); } else { @@ -639,4 +640,17 @@ class UserVM extends BaseVM { _loginOtherAccount = true; navigateReplaceWithName(context, AppRoutes.loginWithPassword); } + + void changeLanguage(BuildContext context) { + if (EasyLocalization.of(context)?.currentLocale?.countryCode == "SA") { + context.setLocale(const Locale("en", "US")); + } else { + context.setLocale(const Locale('ar', 'SA')); + } + notifyListeners(); + } + + void logout(BuildContext context) { + navigateReplaceWithNameUntilRoute(context, AppRoutes.loginWithPassword); + } } diff --git a/lib/views/appointments/review_appointment_view.dart b/lib/views/appointments/review_appointment_view.dart index 57b81c7..75e7e39 100644 --- a/lib/views/appointments/review_appointment_view.dart +++ b/lib/views/appointments/review_appointment_view.dart @@ -219,7 +219,7 @@ class ReviewAppointment extends StatelessWidget { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - LocaleKeys.amount + LocaleKeys.amountVAR .tr() .toText(fontSize: 16, isBold: true), Row( diff --git a/lib/views/appointments/widgets/customer_appointment_slider_widget.dart b/lib/views/appointments/widgets/customer_appointment_slider_widget.dart index 5eb7be0..4374a5a 100644 --- a/lib/views/appointments/widgets/customer_appointment_slider_widget.dart +++ b/lib/views/appointments/widgets/customer_appointment_slider_widget.dart @@ -24,24 +24,23 @@ class CustomerAppointmentSliderWidget extends StatelessWidget { Widget getCorouselWidget(AppType appType, AppointmentsVM appointmentsVM) { return CarouselSlider.builder( options: CarouselOptions( - height: 110, + height: appType == AppType.provider ? 110 : 140, viewportFraction: 1.0, enlargeCenterPage: false, enableInfiniteScroll: false, ), itemCount: appointmentsVM.myUpComingAppointments.length, - itemBuilder: (BuildContext context, int itemIndex, int pageViewIndex) => - BuildAppointmentContainerForCustomer( - isForHome: true, - appointmentListModel: appointmentsVM.myUpComingAppointments[itemIndex], - onTapped: () { - if (appType == AppType.provider) { - onAppointmentClick!(appointmentsVM.myUpComingAppointments[itemIndex]); - } else { - navigateWithName(context, AppRoutes.appointmentDetailView, arguments: appointmentsVM.myUpComingAppointments[itemIndex]); - } - }, - ), + itemBuilder: (BuildContext context, int itemIndex, int pageViewIndex) => BuildAppointmentContainerForCustomer( + isForHome: appType == AppType.provider, + appointmentListModel: appointmentsVM.myUpComingAppointments[itemIndex], + onTapped: () { + if (appType == AppType.provider) { + onAppointmentClick!(appointmentsVM.myUpComingAppointments[itemIndex]); + } else { + navigateWithName(context, AppRoutes.appointmentDetailView, arguments: appointmentsVM.myUpComingAppointments[itemIndex]); + } + }, + ), ); } @@ -179,7 +178,7 @@ class BuildAppointmentContainerForCustomer extends StatelessWidget { List servicesList = List.generate( 2, - (index) => showServices(appointmentListModel.appointmentServicesList![index].providerServiceDescription, MyAssets.modificationsIcon), + (index) => showServices(appointmentListModel.appointmentServicesList![index].providerServiceDescription, MyAssets.modificationsIcon), ); if (appointmentListModel.appointmentServicesList!.length > 1) { @@ -205,17 +204,17 @@ class BuildAppointmentContainerForCustomer extends StatelessWidget { children: [ isForHome != null && isForHome! ? Image.asset( - MyAssets.bnCar, - width: 56, - height: 56, - fit: BoxFit.fill, - ).toCircle(borderRadius: 100) + MyAssets.bnCar, + width: 56, + height: 56, + fit: BoxFit.fill, + ).toCircle(borderRadius: 100) : Image.asset( - MyAssets.bnCar, - width: 80, - height: 85, - fit: BoxFit.cover, - ), + MyAssets.bnCar, + width: 80, + height: 85, + fit: BoxFit.cover, + ), 8.width, Expanded( child: Column( @@ -237,31 +236,31 @@ class BuildAppointmentContainerForCustomer extends StatelessWidget { 9.height, isForHome != null && isForHome! ? Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - "Appointment Details".toText( - color: MyColors.primaryColor, - isUnderLine: true, - isBold: true, - fontSize: 14, - ), - const Icon(Icons.arrow_forward), - ], - ) + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + "Appointment Details".toText( + color: MyColors.primaryColor, + isUnderLine: true, + isBold: true, + fontSize: 14, + ), + const Icon(Icons.arrow_forward), + ], + ) : Row( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Expanded( - child: Column( - children: buildServicesFromAppointment(appointmentListModel: appointmentListModel!), + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded( + child: Column( + children: buildServicesFromAppointment(appointmentListModel: appointmentListModel!), + ), + ), + const Icon( + Icons.arrow_forward, + ), + ], ), - ), - const Icon( - Icons.arrow_forward, - ), - ], - ), ], ), ), diff --git a/lib/views/setting_options/setting_options_language.dart b/lib/views/setting_options/setting_options_language.dart index 69a5bea..282ab5d 100644 --- a/lib/views/setting_options/setting_options_language.dart +++ b/lib/views/setting_options/setting_options_language.dart @@ -10,6 +10,7 @@ import 'package:mc_common_app/theme/colors.dart'; import 'package:mc_common_app/utils/enums.dart'; import 'package:mc_common_app/utils/navigator.dart'; import 'package:mc_common_app/view_models/dashboard_view_model_customer.dart'; +import 'package:mc_common_app/view_models/user_view_model.dart'; import 'package:mc_common_app/views/setting_options/widgets/custom_setting_options_tile.dart'; import 'package:mc_common_app/widgets/button/show_fill_button.dart'; import 'package:mc_common_app/widgets/common_widgets/app_bar.dart'; @@ -40,8 +41,7 @@ class SettingOptionsLanguage extends StatelessWidget { Column( children: [ CustomSettingOptionsTile( - leadingWidget: - const Icon(Icons.quickreply_outlined, size: 20), + leadingWidget: const Icon(Icons.quickreply_outlined, size: 20), titleText: LocaleKeys.requests.tr(), needBorderBelow: true, onTap: () { @@ -56,12 +56,10 @@ class SettingOptionsLanguage extends StatelessWidget { //navigateWithName(context, AppRoutes.settingOptionsInviteFriends), ), CustomSettingOptionsTile( - leadingWidget: - const Icon(Icons.question_mark_outlined, size: 20), + leadingWidget: const Icon(Icons.question_mark_outlined, size: 20), titleText: LocaleKeys.help.tr(), needBorderBelow: true, - onTap: () => - navigateWithName(context, AppRoutes.settingOptionsHelp), + onTap: () => navigateWithName(context, AppRoutes.settingOptionsHelp), ), CustomSettingOptionsTile( leadingWidget: const Icon(Icons.person, size: 20), @@ -73,29 +71,25 @@ class SettingOptionsLanguage extends StatelessWidget { // Navigator.pop(context); }), ], - ).toWhiteContainer( - width: double.infinity, - pading: const EdgeInsets.all(12), - borderRadius: 0), + ).toWhiteContainer(width: double.infinity, pading: const EdgeInsets.all(12), borderRadius: 0), 10.height, CustomSettingOptionsTile( leadingWidget: const Icon(Icons.translate, size: 20), titleText: LocaleKeys.language.tr(), isForLanguage: true, onTap: () { - if (EasyLocalization.of(context) - ?.currentLocale - ?.countryCode == - "SA") { - context.setLocale(const Locale("en", "US")); - } else { - context.setLocale(const Locale('ar', 'SA')); - } + // if (EasyLocalization.of(context) + // ?.currentLocale + // ?.countryCode == + // "SA") { + // context.setLocale(const Locale("en", "US")); + // } else { + // context.setLocale(const Locale('ar', 'SA')); + // } + + context.read().changeLanguage(context); }, - ).toWhiteContainer( - width: double.infinity, - pading: const EdgeInsets.all(12), - borderRadius: 0), + ).toWhiteContainer(width: double.infinity, pading: const EdgeInsets.all(12), borderRadius: 0), 10.height, (AppState().currentAppType == AppType.provider) ? Column( @@ -114,8 +108,7 @@ class SettingOptionsLanguage extends StatelessWidget { isForLanguage: false, needBorderBelow: true, onTap: () { - navigateWithName( - context, AppRoutes.mySubscriptionsPage); + navigateWithName(context, AppRoutes.mySubscriptionsPage); }, ), CustomSettingOptionsTile( @@ -132,8 +125,7 @@ class SettingOptionsLanguage extends StatelessWidget { isForLanguage: false, needBorderBelow: true, onTap: () { - navigateWithName( - context, AppRoutes.subscriptionsPage); + navigateWithName(context, AppRoutes.subscriptionsPage); }, ), CustomSettingOptionsTile( @@ -150,19 +142,13 @@ class SettingOptionsLanguage extends StatelessWidget { isForLanguage: false, needBorderBelow: false, onTap: () { - navigateWithName( - context, AppRoutes.providerLicensePage); + navigateWithName(context, AppRoutes.providerLicensePage); }, ) ], - ).toWhiteContainer( - width: double.infinity, - pading: const EdgeInsets.all(12), - borderRadius: 0) - : SizedBox(), - (AppState().currentAppType == AppType.provider) - ? 10.height + ).toWhiteContainer(width: double.infinity, pading: const EdgeInsets.all(12), borderRadius: 0) : SizedBox(), + (AppState().currentAppType == AppType.provider) ? 10.height : SizedBox(), ], )), // : Expanded( @@ -188,9 +174,7 @@ class SettingOptionsLanguage extends StatelessWidget { // ], // ), // ), - (AppState().currentAppType == AppType.provider) - ? Text(LocaleKeys.provider.tr()) - : Text(LocaleKeys.customer.tr()), + (AppState().currentAppType == AppType.provider) ? Text(LocaleKeys.provider.tr()) : Text(LocaleKeys.customer.tr()), Row( children: [ Expanded( @@ -201,7 +185,9 @@ class SettingOptionsLanguage extends StatelessWidget { fontSize: 16, maxHeight: 55, title: LocaleKeys.logOut.tr(), - onPressed: () {}, + onPressed: () { + context.read().logout(context); + }, ), ), ], diff --git a/pubspec.yaml b/pubspec.yaml index d03f2c0..4e176a9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -73,10 +73,15 @@ flutter: - assets/icons/ - assets/icons/payments/ - assets/images/ - - assets/fonts/Poppins-Medium.ttf + - assets/fonts/ fonts: - family: Poppins fonts: - asset: assets/fonts/Poppins-Medium.ttf + - family: GessTwo + fonts: + - asset: assets/fonts/GESS-Two-Light.otf + - asset: assets/fonts/GESS-Two-Bold.otf + - asset: assets/fonts/GESS-Two-Medium.otf