From fb41cd0770a201fe64afa4f415d0c48361e470de Mon Sep 17 00:00:00 2001 From: Faiz Hashmi Date: Thu, 17 Oct 2024 16:12:05 +0300 Subject: [PATCH] FixedThings Before QA --- assets/langs/ar-SA.json | 2 +- assets/langs/en-US.json | 2 +- lib/extensions/string_extensions.dart | 26 +++++- lib/generated/codegen_loader.g.dart | 4 +- lib/generated/locale_keys.g.dart | 2 +- lib/main.dart | 3 + .../appointment_list_model.dart | 4 + .../service_schedule_model.dart | 4 + lib/repositories/common_repo.dart | 7 ++ lib/utils/enums.dart | 5 ++ lib/utils/utils.dart | 25 ++---- .../appointments/appointment_detail_view.dart | 85 ++++++++----------- .../book_appointment_schedules_view.dart | 3 +- .../book_appointment_services_view.dart | 1 + .../book_appointments_item_view.dart | 19 +++-- .../appointments/review_appointment_view.dart | 5 +- .../setting_options/setting_option_help.dart | 25 ++---- .../setting_options_language.dart | 31 +++---- lib/views/user/login_with_password_page.dart | 13 ++- 19 files changed, 141 insertions(+), 125 deletions(-) diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index be8b18f..6a96725 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -579,7 +579,7 @@ "requestAlreadyInProgress": "هذا الطلب قيد التقدم بالفعل.", "acceptOfferConfirmation": "هل تريد قبول هذا العرض؟", "acceptOfferConfirmationMessage": "سيتم قبول هذا العرض وستدفع المبلغ المطلوب للمشتري في وقت معين وإلا سيتم إلغاء هذا العرض.", - "noUpcomingAppointments": "لا يوجد موعد قادم متاح", + "noUpcomingAppointments": "لا مواعيد قادم..", "addNewAppointment": "إضافة موعد جديد", "myNearbyBranches": "فروعي القريبة", "myRecentBranches": "فروعي الأخيرة", diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 08a3a39..3d26af4 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -580,7 +580,7 @@ "upgradeVar": "Upgrade", "whendoyouWanttoRenew": "When do you want to renew", "renewVar": "Renew", - "noUpcomingAppointments": "No Upcoming Appointment Available.", + "noUpcomingAppointments": "No Upcoming Appointments.", "addNewAppointment": "Add New Appointment", "myNearbyBranches": "My Nearby Branches", "myRecentBranches": "My Recent Branches", diff --git a/lib/extensions/string_extensions.dart b/lib/extensions/string_extensions.dart index 8055de3..7dc07d5 100644 --- a/lib/extensions/string_extensions.dart +++ b/lib/extensions/string_extensions.dart @@ -3,7 +3,6 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/cupertino.dart'; import 'package:mc_common_app/classes/app_state.dart'; import 'package:mc_common_app/classes/consts.dart'; -import 'package:mc_common_app/main.dart'; import 'package:mc_common_app/theme/colors.dart'; import 'package:mc_common_app/utils/date_helper.dart'; import 'package:mc_common_app/utils/enums.dart'; @@ -283,6 +282,31 @@ extension AppointmentStatusToInt on AppointmentStatusEnum { } } +extension AppointmentTypeEnumExt on int { + AppointmentTypeEnum toAppointmentTypeEnum() { + if (this == 1) { + return AppointmentTypeEnum.workshop; + } else if (this == 2) { + return AppointmentTypeEnum.home; + } else { + return AppointmentTypeEnum.workshop; + } + } +} + +extension AppointmentTypeEnumExtString on AppointmentTypeEnum { + int getIdFromAppointmentTypeEnum() { + switch (this) { + case AppointmentTypeEnum.workshop: + return 1; + case AppointmentTypeEnum.home: + return 2; + default: + return 1; + } + } +} + extension AppointmentStatusToString on AppointmentStatusEnum { String getAppointmentNameFromEnum() { switch (this) { diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index bc65789..591c656 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -595,7 +595,7 @@ class CodegenLoader extends AssetLoader{ "requestAlreadyInProgress": "هذا الطلب قيد التقدم بالفعل.", "acceptOfferConfirmation": "هل تريد قبول هذا العرض؟", "acceptOfferConfirmationMessage": "سيتم قبول هذا العرض وستدفع المبلغ المطلوب للمشتري في وقت معين وإلا سيتم إلغاء هذا العرض.", - "noUpcomingAppointments": "لا يوجد موعد قادم متاح", + "noUpcomingAppointments": "لا مواعيد قادم..", "addNewAppointment": "إضافة موعد جديد", "myNearbyBranches": "فروعي القريبة", "myRecentBranches": "فروعي الأخيرة", @@ -1271,7 +1271,7 @@ static const Map en_US = { "upgradeVar": "Upgrade", "whendoyouWanttoRenew": "When do you want to renew", "renewVar": "Renew", - "noUpcomingAppointments": "No Upcoming Appointment Available.", + "noUpcomingAppointments": "No Upcoming Appointments.", "addNewAppointment": "Add New Appointment", "myNearbyBranches": "My Nearby Branches", "myRecentBranches": "My Recent Branches", diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index d87c01b..2e0162c 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -651,8 +651,8 @@ abstract class LocaleKeys { static const deleteScheduleAdConfirmationMessage = 'deleteScheduleAdConfirmationMessage'; static const branchSchedules = 'branchSchedules'; static const noSchedulesFound = 'noSchedulesFound'; - static const bookAppointmentAtLocation = 'bookAppointmentAtLocation'; static const showServiceAvailability = 'showServiceAvailability'; static const bookAppointmentForServices = 'bookAppointmentForServices'; + static const bookAppointmentAtLocation = 'bookAppointmentAtLocation'; } diff --git a/lib/main.dart b/lib/main.dart index 7d16923..235274f 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -2,6 +2,9 @@ import 'package:logger/logger.dart'; Logger logger = Logger(printer: PrettyPrinter(printEmojis: false, colors: true, printTime: false)); +bool disableThingsForQA = true; + +// Language Tile in Settings // todo terminal command to genertate translation files // flutter pub run easy_localization:generate --source-dir ./assets/langs diff --git a/lib/models/appointments_models/appointment_list_model.dart b/lib/models/appointments_models/appointment_list_model.dart index 5f4f026..bb8353f 100644 --- a/lib/models/appointments_models/appointment_list_model.dart +++ b/lib/models/appointments_models/appointment_list_model.dart @@ -16,6 +16,8 @@ class AppointmentListModel { String? customerName; String? customerMobileNum; int? appointmentType; + AppointmentTypeEnum? appointmentTypeEnum; + String? providerName; String? duration; String? appointmentDate; @@ -45,6 +47,7 @@ class AppointmentListModel { this.customerName, this.customerMobileNum, this.appointmentType, + this.appointmentTypeEnum, this.providerName, this.duration, this.branchName, @@ -76,6 +79,7 @@ class AppointmentListModel { customerName = json['customerName']; customerMobileNum = json['customerMobile']; appointmentType = json['appointmentType']; + appointmentTypeEnum = json['appointmentType'] != null ? (json['appointmentType'] as int).toAppointmentTypeEnum() : AppointmentTypeEnum.workshop; providerName = json['providerName']; duration = json['duration']; appointmentDate = json['appointmentDate']; diff --git a/lib/models/appointments_models/service_schedule_model.dart b/lib/models/appointments_models/service_schedule_model.dart index 7d9444f..a515097 100644 --- a/lib/models/appointments_models/service_schedule_model.dart +++ b/lib/models/appointments_models/service_schedule_model.dart @@ -1,6 +1,7 @@ import 'package:mc_common_app/extensions/string_extensions.dart'; import 'package:mc_common_app/models/services_models/service_model.dart'; import 'package:mc_common_app/models/general_models/widgets_models.dart'; +import 'package:mc_common_app/utils/enums.dart'; class CustomTimeDateSlotModel { TimeSlotModel? date; @@ -19,6 +20,7 @@ class ServiceAppointmentScheduleModel { double? amountTotal; double? amountRem; int? appointmentType; + AppointmentTypeEnum? appointmentTypeEnum; ServiceAppointmentScheduleModel({ this.serviceSlotList, @@ -30,6 +32,7 @@ class ServiceAppointmentScheduleModel { this.amountTotal, this.amountRem, this.appointmentType, + this.appointmentTypeEnum, }); List getFormattedDateTimeSlotPackage() { @@ -105,6 +108,7 @@ class ServiceAppointmentScheduleModel { amountTotal = json['amountTotal']; amountRem = json['amountRem']; appointmentType = json['appointmentType']; + appointmentTypeEnum = json['appointmentType'] != null ? (json['appointmentType'] as int).toAppointmentTypeEnum() : AppointmentTypeEnum.workshop; } } diff --git a/lib/repositories/common_repo.dart b/lib/repositories/common_repo.dart index bd83be8..79358fe 100644 --- a/lib/repositories/common_repo.dart +++ b/lib/repositories/common_repo.dart @@ -11,6 +11,7 @@ import 'package:mc_common_app/models/general_models/generic_resp_model.dart'; import 'package:mc_common_app/models/user_models/cities.dart'; import 'package:mc_common_app/models/user_models/country.dart'; import 'package:mc_common_app/models/user_models/role.dart'; +import 'package:mc_common_app/utils/utils.dart'; abstract class CommonRepo { Future getAllCountries(); @@ -129,6 +130,12 @@ class CommonRepoImp implements CommonRepo { {"id": 2, "enumTypeID": 0, "enumValueStr": "Used", "enumValue": 2, "isActive": true}, ], }; + + if (json.containsKey('StatusMessage')) { + if ((json['StatusMessage'] as String).contains('Internal server error')) { + Utils.showToast("${json['StatusMessage']}"); + } + } List enums = List.generate((json['data'] as List).length, (index) => EnumsModel.fromJson(json['data'][index])); return enums; } diff --git a/lib/utils/enums.dart b/lib/utils/enums.dart index f948197..2549b6e 100644 --- a/lib/utils/enums.dart +++ b/lib/utils/enums.dart @@ -146,6 +146,11 @@ enum BranchStatusEnum { deactivated // 6 } +enum AppointmentTypeEnum { + workshop, + home, +} + enum AppointmentStatusEnum { booked, confirmed, diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart index 4bc0b09..c6a7ca3 100644 --- a/lib/utils/utils.dart +++ b/lib/utils/utils.dart @@ -27,13 +27,7 @@ class Utils { static bool get isLoading => _isLoadingVisible; static void showToast(String message) { - Fluttertoast.showToast(msg: message, - toastLength: Toast.LENGTH_SHORT, - gravity: ToastGravity.BOTTOM, - timeInSecForIosWeb: 2, - backgroundColor: Colors.black54, - textColor: Colors.white, - fontSize: 16.0); + Fluttertoast.showToast(msg: message, toastLength: Toast.LENGTH_SHORT, gravity: ToastGravity.BOTTOM, timeInSecForIosWeb: 2, backgroundColor: Colors.black54, textColor: Colors.white, fontSize: 16.0); } static Future openNumberViaCaller({required String phoneNumber}) async { @@ -76,11 +70,7 @@ class Utils { return ""; } - return ("${timeOfDay.hour - .toString() - .length == 1 ? "0" : ""}${timeOfDay.hour}:${timeOfDay.minute - .toString() - .length == 1 ? "0" : ""}${timeOfDay.minute}").toString(); + return ("${timeOfDay.hour.toString().length == 1 ? "0" : ""}${timeOfDay.hour}:${timeOfDay.minute.toString().length == 1 ? "0" : ""}${timeOfDay.minute}").toString(); } static dynamic getNotNullValue(List list, int index) { @@ -483,7 +473,7 @@ class Utils { border: Border.all( width: w, // color: color // <--- border width here - ), + ), borderRadius: BorderRadius.circular(radius), ); } @@ -506,7 +496,7 @@ class Utils { border: Border.all( width: 1, // color: color // <--- border width here - ), + ), borderRadius: BorderRadius.circular(radius), ); } @@ -524,8 +514,7 @@ class Utils { } static String getAdsPaymentBrowserForm({required int paymentId, required int adId}) { - return '
'; + return '
'; } // BOTTOM SHEETS @@ -550,8 +539,8 @@ class Utils { static Widget buildStatusContainer(String text) { return Center( child: text.toText(color: MyColors.lightTextColor, fontSize: 14 - // isItalic: true, - ), + // isItalic: true, + ), ).toContainer( marginAll: 8, paddingAll: 15, diff --git a/lib/views/appointments/appointment_detail_view.dart b/lib/views/appointments/appointment_detail_view.dart index 1f0046e..52a16bf 100644 --- a/lib/views/appointments/appointment_detail_view.dart +++ b/lib/views/appointments/appointment_detail_view.dart @@ -8,6 +8,7 @@ import 'package:mc_common_app/models/services_models/service_model.dart'; import 'package:mc_common_app/theme/colors.dart'; import 'package:mc_common_app/utils/dialogs_and_bottomsheets.dart'; import 'package:mc_common_app/utils/enums.dart'; +import 'package:mc_common_app/utils/utils.dart'; import 'package:mc_common_app/view_models/appointments_view_model.dart'; import 'package:mc_common_app/widgets/button/show_fill_button.dart'; import 'package:mc_common_app/widgets/common_widgets/app_bar.dart'; @@ -15,6 +16,7 @@ import 'package:mc_common_app/widgets/common_widgets/card_button_with_icon.dart' import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; import 'package:provider/provider.dart'; import 'package:easy_localization/easy_localization.dart'; +import 'package:sizer/sizer.dart'; class AppointmentDetailView extends StatelessWidget { final AppointmentListModel appointmentListModel; @@ -43,15 +45,9 @@ class AppointmentDetailView extends StatelessWidget { case AppointmentPaymentStatusEnum.payPartial: return Align( alignment: Alignment.bottomCenter, - child: Row( - children: [ - getBaseActionButtonWidget( - color: MyColors.grey98Color.withOpacity(0.1), - textColor: MyColors.lightTextColor, - onPressed: () {}, - text: LocaleKeys.workInProgress.tr(), - ), - ], + child: SizedBox( + height: 8.h, + child: Utils.buildStatusContainer(LocaleKeys.workInProgress.tr()), ), ); case AppointmentPaymentStatusEnum.payNow: @@ -85,7 +81,7 @@ class AppointmentDetailView extends StatelessWidget { alignment: Alignment.bottomCenter, child: Row( children: [ - getBaseActionButtonWidget(color: MyColors.redColor, onPressed: () => appointmentCancelConfirmationSheet(context), text: "Cancel"), + getBaseActionButtonWidget(color: MyColors.redColor, onPressed: () => appointmentCancelConfirmationSheet(context), text: LocaleKeys.cancel.tr()), 12.width, getBaseActionButtonWidget( color: MyColors.greenColor, @@ -108,15 +104,9 @@ class AppointmentDetailView extends StatelessWidget { case AppointmentStatusEnum.visitCompleted: return Align( alignment: Alignment.bottomCenter, - child: Row( - children: [ - getBaseActionButtonWidget( - color: MyColors.grey98Color.withOpacity(0.3), - textColor: MyColors.lightTextColor, - onPressed: () {}, - text: LocaleKeys.visitCompleted.tr(), - ), - ], + child: SizedBox( + height: 8.h, + child: Utils.buildStatusContainer(LocaleKeys.visitCompleted.tr()), ), ); @@ -126,20 +116,19 @@ class AppointmentDetailView extends StatelessWidget { case AppointmentStatusEnum.cancelled: return Align( alignment: Alignment.bottomCenter, - child: Row( - children: [ - getBaseActionButtonWidget(color: MyColors.grey98Color.withOpacity(0.3), textColor: MyColors.lightTextColor, onPressed: () {}, text: "Cancelled"), - ], + child: SizedBox( + height: 8.h, + child: Utils.buildStatusContainer(LocaleKeys.appointmentCancelled.tr()), ), ); case AppointmentStatusEnum.allAppointments: - return SizedBox(); + return const SizedBox(); case AppointmentStatusEnum.rescheduled: return Align( alignment: Alignment.bottomCenter, child: Row( children: [ - getBaseActionButtonWidget(color: MyColors.redColor, onPressed: () => appointmentCancelConfirmationSheet(context), text: "Cancel"), + getBaseActionButtonWidget(color: MyColors.redColor, onPressed: () => appointmentCancelConfirmationSheet(context), text: LocaleKeys.cancel.tr()), 12.width, getBaseActionButtonWidget( color: MyColors.greenColor, @@ -151,7 +140,7 @@ class AppointmentDetailView extends StatelessWidget { ), ); default: - return SizedBox(); + return const SizedBox(); } } @@ -224,44 +213,40 @@ class AppointmentDetailView extends StatelessWidget { Column( children: List.generate(appointmentListModel.appointmentServicesList!.length, (index) { ServiceModel service = appointmentListModel.appointmentServicesList![index]; - return Column( + return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( + Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - // MyAssets.maintenanceIcon.buildSvg( - // height: 10, - // width: 10, - // fit: BoxFit.fill, - // ), - // 10.width, "${index + 1}. ${service.providerServiceDescription}".toText(fontSize: 14, isBold: true), + if (service.serviceItems != null && service.serviceItems!.isNotEmpty) ...[ + Column( + children: List.generate( + service.serviceItems!.length, + (index) => "${service.serviceItems![index].name}".toText( + textAlign: TextAlign.start, + fontSize: 12, + color: MyColors.lightTextColor, + ), + ), + ).paddingOnly(left: 15), + ], ], ), - if (service.serviceItems != null && service.serviceItems!.isNotEmpty) ...[ - Column( - children: List.generate( - service.serviceItems!.length, - (index) => "${service.serviceItems![index].name}".toText( - textAlign: TextAlign.start, - fontSize: 12, - color: MyColors.lightTextColor, - ), - ), - ).paddingOnly(left: 15), - ], 5.height, Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ - ((service.currentTotalServicePrice).toString()).toText(fontSize: 25, isBold: true), + ((service.currentTotalServicePrice).toString()).toText(fontSize: 19, isBold: true), 2.width, - LocaleKeys.sar.tr().toText(color: MyColors.lightTextColor, fontSize: 16, isBold: true).paddingOnly(bottom: 5), - const Icon(Icons.arrow_drop_down, size: 30) + LocaleKeys.sar.tr().toText(color: MyColors.lightTextColor, fontSize: 12, isBold: true).paddingOnly(bottom: 5), + const Icon(Icons.arrow_drop_down, size: 25) ], ).onPress(() => appointmentsVM.priceBreakDownClicked(context, service)), ], - ); + ).paddingOnly(bottom: 15); }), ), ], diff --git a/lib/views/appointments/book_appointment_schedules_view.dart b/lib/views/appointments/book_appointment_schedules_view.dart index ab527ea..5752f34 100644 --- a/lib/views/appointments/book_appointment_schedules_view.dart +++ b/lib/views/appointments/book_appointment_schedules_view.dart @@ -5,6 +5,7 @@ import 'package:mc_common_app/generated/locale_keys.g.dart'; import 'package:mc_common_app/models/appointments_models/service_schedule_model.dart'; import 'package:mc_common_app/models/services_models/service_model.dart'; import 'package:mc_common_app/theme/colors.dart'; +import 'package:mc_common_app/utils/enums.dart'; import 'package:mc_common_app/view_models/appointments_view_model.dart'; import 'package:mc_common_app/views/appointments/widgets/custom_calender_widget.dart'; import 'package:mc_common_app/widgets/button/show_fill_button.dart'; @@ -62,7 +63,7 @@ class BookAppointmentSchedulesView extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ (LocaleKeys.serviceLocation.tr()).toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true), - (scheduleData.appointmentType == 2 ? LocaleKeys.home.tr() : LocaleKeys.workshop.tr()).toText(fontSize: 12, isBold: true).expand(), + (scheduleData.appointmentTypeEnum == AppointmentTypeEnum.home ? LocaleKeys.home.tr() : LocaleKeys.workshop.tr()).toText(fontSize: 12, isBold: true).expand(), ], ), Column( diff --git a/lib/views/appointments/book_appointment_services_view.dart b/lib/views/appointments/book_appointment_services_view.dart index 99c91c2..cb0d265 100644 --- a/lib/views/appointments/book_appointment_services_view.dart +++ b/lib/views/appointments/book_appointment_services_view.dart @@ -65,6 +65,7 @@ class BookAppointmentServicesView extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ (LocaleKeys.serviceLocation.tr()).toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true), + 4.width, (serviceData.isHomeSelected ? serviceData.homeLocation : LocaleKeys.workshop.tr()).toText(fontSize: 12, isBold: true).expand(), ], ), diff --git a/lib/views/appointments/book_appointments_item_view.dart b/lib/views/appointments/book_appointments_item_view.dart index 046a152..284d348 100644 --- a/lib/views/appointments/book_appointments_item_view.dart +++ b/lib/views/appointments/book_appointments_item_view.dart @@ -49,15 +49,16 @@ class BookAppointmentsItemView extends StatelessWidget { children: [ LocaleKeys.workshopFullAccessServices.tr().toText(fontSize: 12, isItalic: true, color: MyColors.lightTextColor), 8.height, - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - LocaleKeys.changeLocationService.tr().toText(fontSize: 14, isBold: true), - LocaleKeys.edit.tr().toText(fontSize: 14, isBold: true, isUnderLine: true, color: MyColors.adPendingStatusColor), - 5.width, - MyAssets.icEdit.buildSvg(width: 17), - ], - ).onPress(() {}), + // Row( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // LocaleKeys.changeLocationService.tr().toText(fontSize: 14, isBold: true), + // 5.width, + // LocaleKeys.edit.tr().toText(fontSize: 14, isBold: true, isUnderLine: true, color: MyColors.adPendingStatusColor), + // 5.width, + // MyAssets.icEdit.buildSvg(width: 17), + // ], + // ).onPress(() {}), 16.height, const Divider(), ], diff --git a/lib/views/appointments/review_appointment_view.dart b/lib/views/appointments/review_appointment_view.dart index c0af252..7082f4e 100644 --- a/lib/views/appointments/review_appointment_view.dart +++ b/lib/views/appointments/review_appointment_view.dart @@ -8,6 +8,7 @@ import 'package:mc_common_app/models/appointments_models/service_schedule_model. import 'package:mc_common_app/models/services_models/item_model.dart'; import 'package:mc_common_app/models/services_models/service_model.dart'; import 'package:mc_common_app/theme/colors.dart'; +import 'package:mc_common_app/utils/enums.dart'; import 'package:mc_common_app/view_models/appointments_view_model.dart'; import 'package:mc_common_app/widgets/button/show_fill_button.dart'; import 'package:mc_common_app/widgets/common_widgets/app_bar.dart'; @@ -160,7 +161,7 @@ class ReviewAppointment extends StatelessWidget { ]), Row(children: [ ("${LocaleKeys.location.tr()}: ").toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true), - (scheduleData.appointmentType == 2 ? LocaleKeys.home.tr() : LocaleKeys.workshop.tr()).toText(fontSize: 12, isBold: true), + (scheduleData.appointmentTypeEnum == AppointmentTypeEnum.home ? LocaleKeys.home.tr() : LocaleKeys.workshop.tr()).toText(fontSize: 12, isBold: true), ]), ], ), @@ -184,7 +185,7 @@ class ReviewAppointment extends StatelessWidget { "${scheduleData.amountTotal.toString()} ${LocaleKeys.sar.tr()}".toText(fontSize: 16, isBold: true), ], ), - if (scheduleData.appointmentType == 1) ...[ + if (scheduleData.appointmentTypeEnum == AppointmentTypeEnum.home) ...[ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ diff --git a/lib/views/setting_options/setting_option_help.dart b/lib/views/setting_options/setting_option_help.dart index 9768496..6ffb72f 100644 --- a/lib/views/setting_options/setting_option_help.dart +++ b/lib/views/setting_options/setting_option_help.dart @@ -37,22 +37,15 @@ class SettingOptionsHelp extends StatelessWidget { leadingWidget: const Icon(Icons.mail, size: 20), titleText: LocaleKeys.contactUs.tr(), needBorderBelow: true, - onTap: () => navigateWithName( - context, AppRoutes.settingOptionsFaqs), + onTap: () => navigateWithName(context, AppRoutes.settingOptionsFaqs), ), CustomSettingOptionsTile( leadingWidget: const Icon(Icons.lock, size: 20), titleText: LocaleKeys.termPrivacy.tr(), - onTap: () => - navigateWithName(context, AppRoutes.profileView), + onTap: () {}, ), ], - ).toContainer( - width: double.infinity, - isShadowEnabled: true, - paddingAll: 10, - margin: const EdgeInsets.fromLTRB(24, 24, 24, 0), - borderRadius: 0), + ).toContainer(width: double.infinity, isShadowEnabled: true, paddingAll: 10, margin: const EdgeInsets.fromLTRB(24, 24, 24, 0), borderRadius: 0), ], ), ), @@ -69,13 +62,7 @@ class CustomSettingOptionsTile extends StatelessWidget { final bool isForLanguage; final Function() onTap; - const CustomSettingOptionsTile( - {super.key, - required this.leadingWidget, - required this.onTap, - required this.titleText, - this.needBorderBelow = false, - this.isForLanguage = false}); + const CustomSettingOptionsTile({super.key, required this.leadingWidget, required this.onTap, required this.titleText, this.needBorderBelow = false, this.isForLanguage = false}); @override Widget build(BuildContext context) { @@ -91,9 +78,7 @@ class CustomSettingOptionsTile extends StatelessWidget { titleText.toText(fontSize: 16), ], ), - isForLanguage - ? const Icon(Icons.language, size: 18) - : const Icon(Icons.arrow_forward, size: 18) + isForLanguage ? const Icon(Icons.language, size: 18) : const Icon(Icons.arrow_forward, size: 18) ], ).onPress(onTap), 5.height, diff --git a/lib/views/setting_options/setting_options_language.dart b/lib/views/setting_options/setting_options_language.dart index 7f6ca57..e501d1d 100644 --- a/lib/views/setting_options/setting_options_language.dart +++ b/lib/views/setting_options/setting_options_language.dart @@ -6,11 +6,10 @@ import 'package:mc_common_app/classes/consts.dart'; import 'package:mc_common_app/config/routes.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/main.dart'; 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/base_view_model.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'; @@ -87,18 +86,20 @@ class _SettingOptionsLanguageState extends State { ], ).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: () { - context.read().changeLanguage(context); - Future.delayed(Duration(seconds: 1), () { - setState(() {}); - }); - }, - ).toWhiteContainer(width: double.infinity, pading: const EdgeInsets.all(12), borderRadius: 0), - 10.height, + if (!disableThingsForQA) ...[ + CustomSettingOptionsTile( + leadingWidget: const Icon(Icons.translate, size: 20), + titleText: LocaleKeys.language.tr(), + isForLanguage: true, + onTap: () { + context.read().changeLanguage(context); + Future.delayed(const Duration(seconds: 1), () { + setState(() {}); + }); + }, + ).toWhiteContainer(width: double.infinity, pading: const EdgeInsets.all(12), borderRadius: 0), + 10.height, + ], (AppState().currentAppType == AppType.provider) ? Column( children: [ @@ -112,7 +113,7 @@ class _SettingOptionsLanguageState extends State { ), ), titleText: LocaleKeys.mySubscription.tr(), - subTitle: AppState().getproviderSubscription != null ? AppState().getproviderSubscription.first.name ?? "Silver" : "", + subTitle: AppState().getproviderSubscription.first.name ?? "", isForLanguage: false, needBorderBelow: true, onTap: () { diff --git a/lib/views/user/login_with_password_page.dart b/lib/views/user/login_with_password_page.dart index 6cabdb9..f159b4b 100644 --- a/lib/views/user/login_with_password_page.dart +++ b/lib/views/user/login_with_password_page.dart @@ -93,10 +93,15 @@ class _LoginWithPasswordState extends State { child: Column( children: [ 12.height, - LocaleKeys.login.tr().toText( - fontSize: 20, - letterSpacing: -1.44, - ), + (AppState().currentAppType == AppType.provider ? "Provider" : "Customer").toText( + fontSize: 25, + letterSpacing: -1.44, + ), + 8.height, + (LocaleKeys.login.tr()).toText( + fontSize: 20, + letterSpacing: -1.44, + ), // 20.height, // (type == ClassType.NUMBER ? LocaleKeys.\enterPhoneNumber.tr() : LocaleKeys.enterEmail.tr()).toText14( // color: MyColors.lightTextColor,