From 885b922a41e9d2d87ff33d3ec0c5c89a7ab4f9aa Mon Sep 17 00:00:00 2001 From: "Fatimah.Alshammari" Date: Thu, 7 May 2026 11:34:14 +0300 Subject: [PATCH] fix localization and UI updates --- lib/view_models/schedule_view_model.dart | 16 +- .../appointment_detail_list_widget.dart | 218 ++++++++-------- .../services/create_item_page.dart | 29 ++- .../services/items_list_page.dart | 6 +- .../sheet/degrage_package_sheet.dart | 244 +++++++++--------- .../sheet/select_package_sheet.dart | 180 ++++++------- .../sheet/upgrade_package_sheet.dart | 6 +- .../widget/all_subscriptions_card.dart | 6 +- .../widget/my_subscriptions_card.dart | 15 +- pubspec.yaml | 5 +- 10 files changed, 376 insertions(+), 349 deletions(-) diff --git a/lib/view_models/schedule_view_model.dart b/lib/view_models/schedule_view_model.dart index b0cb14e..8148166 100644 --- a/lib/view_models/schedule_view_model.dart +++ b/lib/view_models/schedule_view_model.dart @@ -1,3 +1,4 @@ +import 'package:mc_common_app/generated/locale_keys.g.dart'; import 'package:mc_common_app/models/appointments_models/schedule_model.dart'; import 'package:mc_common_app/models/general_models/generic_resp_model.dart'; import 'package:mc_common_app/models/provider_branches_models/profile/services.dart'; @@ -6,15 +7,16 @@ import 'package:car_provider_app/views/branch_management/schedule/widgets/chips_ import 'package:mc_common_app/utils/enums.dart'; import 'package:mc_common_app/utils/utils.dart'; import 'package:mc_common_app/view_models/base_view_model.dart'; +import 'package:easy_localization/easy_localization.dart'; List initDaysList = [ - PickerItem(id: 1, title: "Sunday", isSelected: false), - PickerItem(id: 2, title: "Monday", isSelected: false), - PickerItem(id: 3, title: "Tuesday", isSelected: false), - PickerItem(id: 4, title: "Wednesday", isSelected: false), - PickerItem(id: 5, title: "Thursday", isSelected: false), - PickerItem(id: 6, title: "Friday", isSelected: false), - PickerItem(id: 7, title: "Saturday", isSelected: false), + PickerItem(id: 1, title: LocaleKeys.sunday.tr(), isSelected: false), + PickerItem(id: 2, title: LocaleKeys.monday.tr(), isSelected: false), + PickerItem(id: 3, title: LocaleKeys.tuesday.tr(), isSelected: false), + PickerItem(id: 4, title: LocaleKeys.wednesday.tr(), isSelected: false), + PickerItem(id: 5, title: LocaleKeys.thursday.tr(), isSelected: false), + PickerItem(id: 6, title: LocaleKeys.friday.tr(), isSelected: false), + PickerItem(id: 7, title: LocaleKeys.saturday.tr(), isSelected: false), ]; class ScheduleVM extends BaseVM { diff --git a/lib/views/appoinments/widget/appointment_detail_list_widget.dart b/lib/views/appoinments/widget/appointment_detail_list_widget.dart index 3e120ec..da69015 100644 --- a/lib/views/appoinments/widget/appointment_detail_list_widget.dart +++ b/lib/views/appoinments/widget/appointment_detail_list_widget.dart @@ -1,109 +1,109 @@ -import 'package:car_provider_app/config/provider_routes.dart'; -import 'package:flutter/material.dart'; -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/extensions/string_extensions.dart'; -import 'package:mc_common_app/generated/locale_keys.g.dart'; -import 'package:mc_common_app/theme/colors.dart'; -import 'package:mc_common_app/utils/navigator.dart'; -import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:easy_localization/easy_localization.dart'; - - -class AppointmentDetailListWidget extends StatelessWidget { - bool isNeedClick; - - AppointmentDetailListWidget({Key? key, this.isNeedClick = true}) : super(key: key); - - @override - Widget build(BuildContext context) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - "Olaya Brach".toText( - fontSize: 12, - color: MyColors.darkTextColor, - isBold: true, - ), - "Abdullah Alhbas".toText( - fontSize: 14, - isBold: true, - ), - Row( - children: [ - "Appt. On:".toText( - color: MyColors.lightTextColor, - ), - 2.width, - "19-Mar-2023 11:48 AM".toText(), - ], - ), - ], - ), - ), - SvgPicture.asset( - MyAssets.icEdit, - color: Colors.black, - width: 20, - height: 20, - ) - ], - ), - 8.height, - showServices("Maintenance"), - 2.height, - showServices("Accessories and Modification"), - 24.height, - LocaleKeys.totalAmount.tr().toText( - fontSize: 12, - color: MyColors.lightTextColor, - isBold: true, - ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - "30,000".toText(fontSize: 16, isBold: true), - 2.width, - LocaleKeys.sar.tr().toText( - color: MyColors.lightTextColor, - ), - ], - ), - ], - ).toWhiteContainer( - width: double.infinity, - allPading: 12, - onTap: () { - if (isNeedClick) navigateWithName(context, AppRoutes.updateAppointmentPage); - }, - ); - } - - Widget showServices(String title) { - return Row( - children: [ - const Icon( - Icons.ac_unit, - color: MyColors.primaryColor, - size: 18, - ), - 8.width, - title.toText( - fontSize: 14, - isBold: true, - ), - ], - ); - } -} +// import 'package:car_provider_app/config/provider_routes.dart'; +// import 'package:flutter/material.dart'; +// 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/extensions/string_extensions.dart'; +// import 'package:mc_common_app/generated/locale_keys.g.dart'; +// import 'package:mc_common_app/theme/colors.dart'; +// import 'package:mc_common_app/utils/navigator.dart'; +// import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; +// import 'package:flutter_svg/flutter_svg.dart'; +// import 'package:easy_localization/easy_localization.dart'; +// +// +// class AppointmentDetailListWidget extends StatelessWidget { +// bool isNeedClick; +// +// AppointmentDetailListWidget({Key? key, this.isNeedClick = true}) : super(key: key); +// +// @override +// Widget build(BuildContext context) { +// return Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// Row( +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// Expanded( +// child: Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// mainAxisAlignment: MainAxisAlignment.start, +// children: [ +// "Olaya Brach".toText( +// fontSize: 12, +// color: MyColors.darkTextColor, +// isBold: true, +// ), +// "Abdullah Alhbas".toText( +// fontSize: 14, +// isBold: true, +// ), +// Row( +// children: [ +// "Appt. On:".toText( +// color: MyColors.lightTextColor, +// ), +// 2.width, +// "19-Mar-2023 11:48 AM".toText(), +// ], +// ), +// ], +// ), +// ), +// SvgPicture.asset( +// MyAssets.icEdit, +// color: Colors.black, +// width: 20, +// height: 20, +// ) +// ], +// ), +// 8.height, +// showServices("Maintenance"), +// 2.height, +// showServices("Accessories and Modification"), +// 24.height, +// LocaleKeys.totalAmount.tr().toText( +// fontSize: 12, +// color: MyColors.lightTextColor, +// isBold: true, +// ), +// Row( +// mainAxisAlignment: MainAxisAlignment.start, +// crossAxisAlignment: CrossAxisAlignment.end, +// children: [ +// "30,000".toText(fontSize: 16, isBold: true), +// 2.width, +// LocaleKeys.sar.tr().toText( +// color: MyColors.lightTextColor, +// ), +// ], +// ), +// ], +// ).toWhiteContainer( +// width: double.infinity, +// allPading: 12, +// onTap: () { +// if (isNeedClick) navigateWithName(context, AppRoutes.updateAppointmentPage); +// }, +// ); +// } +// +// Widget showServices(String title) { +// return Row( +// children: [ +// const Icon( +// Icons.ac_unit, +// color: MyColors.primaryColor, +// size: 18, +// ), +// 8.width, +// title.toText( +// fontSize: 14, +// isBold: true, +// ), +// ], +// ); +// } +// } diff --git a/lib/views/branch_management/services/create_item_page.dart b/lib/views/branch_management/services/create_item_page.dart index ac6297d..a5b059d 100644 --- a/lib/views/branch_management/services/create_item_page.dart +++ b/lib/views/branch_management/services/create_item_page.dart @@ -195,7 +195,7 @@ class _CreateItemPageState extends State { ), ), ShowFillButton( - title: (itemData!.isUpdateOrSelected ?? false) ? "Update Item" : "Create Item", + title: (itemData!.isUpdateOrSelected ?? false) ? LocaleKeys.updateItem.tr() : LocaleKeys.createItem.tr(), maxWidth: double.infinity, onPressed: () async { if (validation()) { @@ -260,20 +260,39 @@ class _CreateItemPageState extends State { ); } + // bool validation() { + // bool valid = true; + // if (pickedImage.isEmpty && file == null) { + // Utils.showToast("Please add al least one item image."); + // valid = false; + // } + // if (name == null || name!.length < 3) { + // Utils.showToast("Please add valid item name"); + // valid = false; + // } else if (description == null || description!.length < 3) { + // Utils.showToast("Please add valid item description"); + // valid = false; + // } else if (price == null) { + // Utils.showToast("Please add valid item price"); + // valid = false; + // } + // return valid; + // } + bool validation() { bool valid = true; if (pickedImage.isEmpty && file == null) { - Utils.showToast("Please add al least one item image."); + Utils.showToast(LocaleKeys.pleaseAddAtLeastOneItemImage.tr()); valid = false; } if (name == null || name!.length < 3) { - Utils.showToast("Please add valid item name"); + Utils.showToast(LocaleKeys.pleaseAddValidItemName.tr()); valid = false; } else if (description == null || description!.length < 3) { - Utils.showToast("Please add valid item description"); + Utils.showToast(LocaleKeys.pleaseAddValidItemDescription.tr()); valid = false; } else if (price == null) { - Utils.showToast("Please add valid item price"); + Utils.showToast(LocaleKeys.pleaseAddValidItemPrice.tr()); valid = false; } return valid; diff --git a/lib/views/branch_management/services/items_list_page.dart b/lib/views/branch_management/services/items_list_page.dart index cac989e..5fe12f2 100644 --- a/lib/views/branch_management/services/items_list_page.dart +++ b/lib/views/branch_management/services/items_list_page.dart @@ -58,11 +58,11 @@ class ItemsListPage extends StatelessWidget { children: [ model.serviceItems!.data![index].name.toString().toText(fontSize: 16, isBold: true), 4.height, - showItem("${LocaleKeys.availableforAppointment.tr()}:", (model.serviceItems!.data![index].isAllowAppointment ?? false) ? "Yes" : "No", + showItem("${LocaleKeys.availableforAppointment.tr()}:", (model.serviceItems!.data![index].isAllowAppointment ?? false) ? LocaleKeys.yes.tr() : LocaleKeys.no.tr(), valueColor: Colors.green), - showItem("${LocaleKeys.allowingWorkshopService.tr()}:", (model.serviceItems!.data![index].isAppointmentCompanyLoc ?? false) ? "Yes" : "No", + showItem("${LocaleKeys.allowingWorkshopService.tr()}:", (model.serviceItems!.data![index].isAppointmentCompanyLoc ?? false) ? LocaleKeys.yes.tr() : LocaleKeys.no.tr(), valueColor: Colors.green), - showItem("${LocaleKeys.allowingHomeService.tr()}:", (model.serviceItems!.data![index].isAppointmentCustomerLoc ?? false) ? "Yes" : "No", + showItem("${LocaleKeys.allowingHomeService.tr()}:", (model.serviceItems!.data![index].isAppointmentCustomerLoc ?? false) ? LocaleKeys.yes.tr() : LocaleKeys.no.tr(), valueColor: Colors.green), 12.height, LocaleKeys.serviceAmount.tr().toText(fontSize: 13, color: MyColors.lightTextColor), diff --git a/lib/views/subscriptions/sheet/degrage_package_sheet.dart b/lib/views/subscriptions/sheet/degrage_package_sheet.dart index c480ee1..9714ef9 100644 --- a/lib/views/subscriptions/sheet/degrage_package_sheet.dart +++ b/lib/views/subscriptions/sheet/degrage_package_sheet.dart @@ -1,122 +1,122 @@ -import 'package:flutter/material.dart'; -import 'package:mc_common_app/extensions/int_extensions.dart'; -import 'package:mc_common_app/extensions/string_extensions.dart'; -import 'package:mc_common_app/theme/colors.dart'; -import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; - -class DegradePackageSheet extends StatelessWidget { - const DegradePackageSheet({super.key}); - - @override - Widget build(BuildContext context) { - return Container( - width: double.infinity, - padding: const EdgeInsets.all(12), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - "Deactivate the branches & users ".toText( - fontSize: 18, - isBold: true, - ), - "To select this subscription you need to deactivate your branches and users as this package only supports 1 branch and 2 users per branch. You can reactivate these branches later after upgrading the package" - .toText( - fontSize: 14, - color: MyColors.lightTextColor, - ), - 12.height, - showBranchList(), - 12.height, - ], - ), - ); - } - - Widget showBranchList() { - return ListView.separated( - itemBuilder: (context, index) { - return Column( - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - customCheckBox(true), - 12.width, - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - "Olaya Branch".toText( - fontSize: 16, - isBold: true, - ), - "3 Users".toText( - fontSize: 10, - color: MyColors.lightTextColor, - ), - ], - ), - ), - IconButton( - onPressed: () {}, - icon: const Icon( - Icons.keyboard_arrow_down, - ), - ) - ], - ), - showUser("Mirza"), - 12.height, - showUser("Shafique"), - ], - ).toContainer( - isShadowEnabled: true, - borderRadius: 0, - paddingAll: 12, - ); - }, - separatorBuilder: (context, index) { - return 12.height; - }, - physics: const NeverScrollableScrollPhysics(), - shrinkWrap: true, - itemCount: 2, - ); - } - - Widget showUser(String user) { - return Row( - children: [ - const SizedBox( - width: 24, - ), - customCheckBox(false), - 12.width, - user.toText(fontSize: 14), - ], - ); - } - - Widget customCheckBox(bool isChecked) { - return SizedBox( - height: 18, - width: 18, - child: isChecked - ? const Icon( - Icons.done, - color: Colors.white, - size: 14, - ) - : const SizedBox(), - ).toContainer( - isEnabledBorder: true, - paddingAll: 0, - borderRadius: 0, - borderWidget: 1, - borderColor: MyColors.primaryColor, - backgroundColor: isChecked ? MyColors.primaryColor : Colors.transparent, - ); - } -} +// import 'package:flutter/material.dart'; +// import 'package:mc_common_app/extensions/int_extensions.dart'; +// import 'package:mc_common_app/extensions/string_extensions.dart'; +// import 'package:mc_common_app/theme/colors.dart'; +// import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; +// +// class DegradePackageSheet extends StatelessWidget { +// const DegradePackageSheet({super.key}); +// +// @override +// Widget build(BuildContext context) { +// return Container( +// width: double.infinity, +// padding: const EdgeInsets.all(12), +// child: Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// mainAxisAlignment: MainAxisAlignment.start, +// children: [ +// "Deactivate the branches & users ".toText( +// fontSize: 18, +// isBold: true, +// ), +// "To select this subscription you need to deactivate your branches and users as this package only supports 1 branch and 2 users per branch. You can reactivate these branches later after upgrading the package" +// .toText( +// fontSize: 14, +// color: MyColors.lightTextColor, +// ), +// 12.height, +// showBranchList(), +// 12.height, +// ], +// ), +// ); +// } +// +// Widget showBranchList() { +// return ListView.separated( +// itemBuilder: (context, index) { +// return Column( +// children: [ +// Row( +// crossAxisAlignment: CrossAxisAlignment.start, +// mainAxisAlignment: MainAxisAlignment.start, +// children: [ +// customCheckBox(true), +// 12.width, +// Expanded( +// child: Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// "Olaya Branch".toText( +// fontSize: 16, +// isBold: true, +// ), +// "3 Users".toText( +// fontSize: 10, +// color: MyColors.lightTextColor, +// ), +// ], +// ), +// ), +// IconButton( +// onPressed: () {}, +// icon: const Icon( +// Icons.keyboard_arrow_down, +// ), +// ) +// ], +// ), +// showUser("Mirza"), +// 12.height, +// showUser("Shafique"), +// ], +// ).toContainer( +// isShadowEnabled: true, +// borderRadius: 0, +// paddingAll: 12, +// ); +// }, +// separatorBuilder: (context, index) { +// return 12.height; +// }, +// physics: const NeverScrollableScrollPhysics(), +// shrinkWrap: true, +// itemCount: 2, +// ); +// } +// +// Widget showUser(String user) { +// return Row( +// children: [ +// const SizedBox( +// width: 24, +// ), +// customCheckBox(false), +// 12.width, +// user.toText(fontSize: 14), +// ], +// ); +// } +// +// Widget customCheckBox(bool isChecked) { +// return SizedBox( +// height: 18, +// width: 18, +// child: isChecked +// ? const Icon( +// Icons.done, +// color: Colors.white, +// size: 14, +// ) +// : const SizedBox(), +// ).toContainer( +// isEnabledBorder: true, +// paddingAll: 0, +// borderRadius: 0, +// borderWidget: 1, +// borderColor: MyColors.primaryColor, +// backgroundColor: isChecked ? MyColors.primaryColor : Colors.transparent, +// ); +// } +// } diff --git a/lib/views/subscriptions/sheet/select_package_sheet.dart b/lib/views/subscriptions/sheet/select_package_sheet.dart index 266c84d..2667585 100644 --- a/lib/views/subscriptions/sheet/select_package_sheet.dart +++ b/lib/views/subscriptions/sheet/select_package_sheet.dart @@ -1,89 +1,91 @@ -import 'package:car_provider_app/views/subscriptions/sheet/degrage_package_sheet.dart'; -import 'package:flutter/material.dart'; -import 'package:mc_common_app/extensions/int_extensions.dart'; -import 'package:mc_common_app/extensions/string_extensions.dart'; -import 'package:mc_common_app/theme/colors.dart'; -import 'package:mc_common_app/widgets/bottom_sheet.dart'; -import 'package:mc_common_app/widgets/button/show_fill_button.dart'; -import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; - -class SelectPackageSheet extends StatelessWidget { - const SelectPackageSheet({super.key}); - - @override - Widget build(BuildContext context) { - return Container( - width: double.infinity, - padding: const EdgeInsets.all(12), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - "When do you want to upgrade".toText( - fontSize: 19, - isBold: true, - ), - 12.height, - showPackage(), - 12.height, - showPackage(), - 12.height, - ShowFillButton( - title: "Upgrade", - maxWidth: double.infinity, - onPressed: () { - showMyBottomSheet(context, child: const DegradePackageSheet()); - }, - ), - 12.height, - ], - ), - ); - } - - Widget showPackage() { - return Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Checkbox( - value: false, - onChanged: (v) {}, - ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - "Now".toText( - fontSize: 16, - isBold: true, - ), - "Your subscription will upgrade now. Affecting from 23 January, 2024" - .toText( - fontSize: 12, - color: MyColors.lightTextColor, - ), - 12.height, - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - "175".toText( - fontSize: 26, - isBold: true, - ), - 2.width, - "SAR".toText( - color: MyColors.lightTextColor, - fontSize: 16, - ), - ], - ) - ], - ), - ) - ], - ).toContainer(isShadowEnabled: true); - } -} +// import 'package:car_provider_app/views/subscriptions/sheet/degrage_package_sheet.dart'; +// import 'package:flutter/material.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/theme/colors.dart'; +// import 'package:mc_common_app/widgets/bottom_sheet.dart'; +// import 'package:mc_common_app/widgets/button/show_fill_button.dart'; +// import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; +// import 'package:easy_localization/easy_localization.dart'; +// +// class SelectPackageSheet extends StatelessWidget { +// const SelectPackageSheet({super.key}); +// +// @override +// Widget build(BuildContext context) { +// return Container( +// width: double.infinity, +// padding: const EdgeInsets.all(12), +// child: Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// mainAxisAlignment: MainAxisAlignment.start, +// children: [ +// LocaleKeys.whendoyouWanttoUpgrade.tr().toText( +// fontSize: 19, +// isBold: true, +// ), +// 12.height, +// showPackage(), +// 12.height, +// showPackage(), +// 12.height, +// ShowFillButton( +// title: LocaleKeys.upgradeVar.tr(), +// maxWidth: double.infinity, +// onPressed: () { +// showMyBottomSheet(context, child: const DegradePackageSheet()); +// }, +// ), +// 12.height, +// ], +// ), +// ); +// } +// +// Widget showPackage() { +// return Row( +// crossAxisAlignment: CrossAxisAlignment.start, +// mainAxisAlignment: MainAxisAlignment.start, +// children: [ +// Checkbox( +// value: false, +// onChanged: (v) {}, +// ), +// Expanded( +// child: Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// mainAxisAlignment: MainAxisAlignment.start, +// children: [ +// LocaleKeys.nowVar.tr().toText( +// fontSize: 16, +// isBold: true, +// ), +// "Your subscription will upgrade now. Affecting from 23 January, 2024" +// .toText( +// fontSize: 12, +// color: MyColors.lightTextColor, +// ), +// 12.height, +// Row( +// mainAxisAlignment: MainAxisAlignment.start, +// crossAxisAlignment: CrossAxisAlignment.end, +// children: [ +// "175".toText( +// fontSize: 26, +// isBold: true, +// ), +// 2.width, +// LocaleKeys.sar.tr().toText( +// color: MyColors.lightTextColor, +// fontSize: 16, +// ), +// ], +// ) +// ], +// ), +// ) +// ], +// ).toContainer(isShadowEnabled: true); +// } +// } diff --git a/lib/views/subscriptions/sheet/upgrade_package_sheet.dart b/lib/views/subscriptions/sheet/upgrade_package_sheet.dart index bf3d96e..0d49976 100644 --- a/lib/views/subscriptions/sheet/upgrade_package_sheet.dart +++ b/lib/views/subscriptions/sheet/upgrade_package_sheet.dart @@ -80,7 +80,8 @@ class _UpgradePackageSheetState extends State { 12.height, packageItem( LocaleKeys.nowVar.tr(), - ("${LocaleKeys.yourSubscriptionUpgradeAffectingFrom.tr()} ${widget.subscription.dateEnd == null ? DateHelper.formatAsDayMonthYear(DateTime.now()) : DateHelper.formatAsDayMonthYear(DateHelper.parseStringToDate(DateHelper.formatDateT(widget.subscription.dateEnd!)))}"), + ("${LocaleKeys.yourSubscriptionUpgradeAffectingFrom.tr()} ${widget.subscription.dateEnd == null ? DateFormat('d MMMM yyyy', context.locale.toString()).format(DateTime.now()) : DateFormat('d MMMM yyyy', context.locale.toString()).format(DateHelper.parseStringToDate(DateHelper.formatDateT(widget.subscription.dateEnd!)))}"), + // ("${LocaleKeys.yourSubscriptionUpgradeAffectingFrom.tr()} ${widget.subscription.dateEnd == null ? DateHelper.formatAsDayMonthYear(DateTime.now()) : DateHelper.formatAsDayMonthYear(DateHelper.parseStringToDate(DateHelper.formatDateT(widget.subscription.dateEnd!)))}"), double.parse(model.newPrice).toStringAsFixed(2), isNowSelected, ).onPress(() { @@ -93,7 +94,8 @@ class _UpgradePackageSheetState extends State { if (AppState().getproviderSubscription.isNotEmpty && !AppState().getproviderSubscription.first.isExpired! && !widget.isRenew) ...[ packageItem( LocaleKeys.upgradeAfterCurrentExpiry.tr(), - ("${LocaleKeys.yourSubscriptionUpgradeCurrentSubscriptionAffectingFrom.tr()} ${AppState().getproviderSubscription.first.dateEnd == null ? "" : AppState().getproviderSubscription.first.dateEnd == null ? DateHelper.formatAsDayMonthYear(DateTime.now()) : DateHelper.formatAsDayMonthYear(DateHelper.parseStringToDate(DateHelper.formatDateT(AppState().getproviderSubscription.first.dateEnd!)))}"), + ("${LocaleKeys.yourSubscriptionUpgradeCurrentSubscriptionAffectingFrom.tr()} ${AppState().getproviderSubscription.first.dateEnd == null ? "" : AppState().getproviderSubscription.first.dateEnd == null ? DateFormat('d MMMM yyyy', context.locale.toString()).format(DateTime.now()) : DateFormat('d MMMM yyyy', context.locale.toString()).format(DateHelper.parseStringToDate(DateHelper.formatDateT(AppState().getproviderSubscription.first.dateEnd!)))}"), + // ("${LocaleKeys.yourSubscriptionUpgradeCurrentSubscriptionAffectingFrom.tr()} ${AppState().getproviderSubscription.first.dateEnd == null ? "" : AppState().getproviderSubscription.first.dateEnd == null ? DateHelper.formatAsDayMonthYear(DateTime.now()) : DateHelper.formatAsDayMonthYear(DateHelper.parseStringToDate(DateHelper.formatDateT(AppState().getproviderSubscription.first.dateEnd!)))}"), widget.subscription.price.toString(), isNowSelected ? false : true, ).onPress(() { diff --git a/lib/views/subscriptions/widget/all_subscriptions_card.dart b/lib/views/subscriptions/widget/all_subscriptions_card.dart index 666f4cc..654984f 100644 --- a/lib/views/subscriptions/widget/all_subscriptions_card.dart +++ b/lib/views/subscriptions/widget/all_subscriptions_card.dart @@ -44,7 +44,7 @@ class AllSubscriptionsCard extends StatelessWidget { color: textColor, ), ), - if (subscription.isMyCurrentPackage!) "Current Package".toText(color: MyColors.primaryColor, fontWeight: MyFonts.SemiBold), + if (subscription.isMyCurrentPackage!) LocaleKeys.currentPackage.tr().toText(color: MyColors.primaryColor, fontWeight: MyFonts.SemiBold), if (!subscription.isMyCurrentPackage!) (subscription.subscriptionTypeEnum)! .getStringSubscriptionTypeEnum() @@ -82,7 +82,7 @@ class AllSubscriptionsCard extends StatelessWidget { children: [ subscription.price.toString().toText(fontSize: 29, isBold: true, color: textColor, letterSpacing: -1.77, height: 1), 2.width, - "${subscription.currency ?? ""} for ${subscription.durationDays} ${LocaleKeys.daysVar.tr()}".toText(color: MyColors.lightTextColor, fontSize: 16, letterSpacing: -0.64).paddingOnly(bottom: 3), + "${subscription.currency ?? ""} ${LocaleKeys.forVar.tr()} ${subscription.durationDays} ${LocaleKeys.daysVar.tr()}".toText(color: MyColors.lightTextColor, fontSize: 16, letterSpacing: -0.64).paddingOnly(bottom: 3), ], ), ), @@ -91,7 +91,7 @@ class AllSubscriptionsCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ - (subscription.subscriptionTypeEnum == SubscriptionTypeEnum.current && subscription.isRenewable!) ? "Renew".toText() : (subscription.subscriptionTypeEnum)!.getStringSubscriptionTypeEnum().toText(), + (subscription.subscriptionTypeEnum == SubscriptionTypeEnum.current && subscription.isRenewable!) ? LocaleKeys.renewVar.tr().toText() : (subscription.subscriptionTypeEnum)!.getStringSubscriptionTypeEnum().toText(), 6.width, const Icon( Icons.arrow_forward, diff --git a/lib/views/subscriptions/widget/my_subscriptions_card.dart b/lib/views/subscriptions/widget/my_subscriptions_card.dart index f33968f..e88a4f1 100644 --- a/lib/views/subscriptions/widget/my_subscriptions_card.dart +++ b/lib/views/subscriptions/widget/my_subscriptions_card.dart @@ -53,7 +53,7 @@ class MySubscriptionsCard extends StatelessWidget { ), ), 5.width, - (subscriptionVM.isExpired! ? "Expired" : "Subscribed").toText(color: subscriptionVM.isExpired! ? MyColors.darkTextColor : MyColors.white) + (subscriptionVM.isExpired! ? LocaleKeys.expired.tr() : LocaleKeys.subscribed.tr()).toText(color: subscriptionVM.isExpired! ? MyColors.darkTextColor : MyColors.white) ], ) .toContainer( @@ -71,9 +71,9 @@ class MySubscriptionsCard extends StatelessWidget { // showItem("Users:", "${pvm.subUsersRemaining.toString()} of ${pvm.totalSubUsers.toString()} remaining"), // showItem("Branches:", "${pvm.branchesRemaining.toString()} of ${pvm.totalBranches.toString()} remaining"), - showItem("Ads: ", "${subscriptionVM.adsRemaining.toString()} remaining"), - showItem("Users: ", "${subscriptionVM.subUsersRemaining.toString()} remaining"), - showItem("Branches: ", "${subscriptionVM.branchesRemaining.toString()} remaining"), + showItem(LocaleKeys.adsWith.tr(), "${subscriptionVM.adsRemaining.toString()} ${LocaleKeys.remaining.tr()}"), + showItem(LocaleKeys.usersWith.tr(), "${subscriptionVM.subUsersRemaining.toString()} ${LocaleKeys.remaining.tr()}"), + showItem(LocaleKeys.branchesWith.tr(), "${subscriptionVM.branchesRemaining.toString()} ${LocaleKeys.remaining.tr()}"), 14.height, Row( @@ -93,7 +93,7 @@ class MySubscriptionsCard extends StatelessWidget { color: textColor, ), 2.width, - " ${LocaleKeys.sar.tr()}/Month".toText(color: MyColors.lightTextColor, fontSize: 16, letterSpacing: -0.64).paddingOnly(bottom: 3), + " ${LocaleKeys.sar.tr()}/${LocaleKeys.month.tr()}".toText(color: MyColors.lightTextColor, fontSize: 16, letterSpacing: -0.64).paddingOnly(bottom: 3), ], ), ), @@ -101,12 +101,13 @@ class MySubscriptionsCard extends StatelessWidget { ), Row( children: [ - "${subscriptionVM.isExpired! ? "Expired" : "Expires"} on ${DateHelper.formatAsDayMonthYear(DateHelper.parseStringToDate(DateHelper.formatDateT(subscriptionVM.dateEnd ?? "")))}".toText(fontSize: 14, letterSpacing: -0.56, color: textColor, fontWeight: MyFonts.Medium), + "${subscriptionVM.isExpired! ? LocaleKeys.expired.tr() : LocaleKeys.expiresOn.tr()} ${DateFormat('d MMMM yyyy', context.locale.toString()).format(DateHelper.parseStringToDate(DateHelper.formatDateT(subscriptionVM.dateEnd ?? "")))}".toText(fontSize: 14, letterSpacing: -0.56, color: textColor, fontWeight: MyFonts.Medium), + // "${subscriptionVM.isExpired! ? LocaleKeys.expired.tr() : LocaleKeys.expiresOn.tr()} ${DateHelper.formatAsDayMonthYear(DateHelper.parseStringToDate(DateHelper.formatDateT(subscriptionVM.dateEnd ?? "")))}".toText(fontSize: 14, letterSpacing: -0.56, color: textColor, fontWeight: MyFonts.Medium), if (subscriptionVM.isRenewable!) Row( children: [ 6.width, - "Renew".toText(color: MyColors.primaryColor, fontSize: 14, letterSpacing: -0.56, textDecoration: TextDecoration.underline, decorationColor: MyColors.primaryColor, fontWeight: MyFonts.Medium), + LocaleKeys.renew.tr().toText(color: MyColors.primaryColor, fontSize: 14, letterSpacing: -0.56, textDecoration: TextDecoration.underline, decorationColor: MyColors.primaryColor, fontWeight: MyFonts.Medium), ], ).onPress(() { onRenewSubscriptionClick(); diff --git a/pubspec.yaml b/pubspec.yaml index 5939aa5..2546272 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -41,8 +41,9 @@ dependencies: mc_common_app: # path: D:\Development\car_common_app # path: /Users/faizhashmi/Development/Projects/MyProjects/CloudSolutions/car_common_app - path: /Volumes/Data/Projects/Flutter_Projects/car_common_app - # path: /Users/aamir/StudioProjects/car_common_app +# path: /Volumes/Data/Projects/Flutter_Projects/car_common_app + + path: C:/dev/Mawater/car_common_app