Merge branch 'fatima_dev' into faiz_development_common

# Conflicts:
#	lib/widgets/dropdown/dropdow_field.dart
master
FaizHashmi 2 weeks ago
commit 944a09be60

@ -921,5 +921,11 @@
"pleaseSelectAccidentFree": "يرجى تحديد ما إذا كانت المركبة خالية من الحوادث", "pleaseSelectAccidentFree": "يرجى تحديد ما إذا كانت المركبة خالية من الحوادث",
"pleaseSelectMileageIncrease": "يرجى تحديد ما إذا كان يمكن زيادة المسافة المقطوعة", "pleaseSelectMileageIncrease": "يرجى تحديد ما إذا كان يمكن زيادة المسافة المقطوعة",
"formatNeedsUpdate": "تنسيق الاعلان يحتاج الى تحديث", "formatNeedsUpdate": "تنسيق الاعلان يحتاج الى تحديث",
"noAdsMatchesYourSearch" :"لا توجد اعلانات تطابق بحثك" "noAdsMatchesYourSearch" :"لا توجد اعلانات تطابق بحثك",
"upgrade": "ترقية",
"downgrade": "تخفيض الباقة",
"current": "الحالية",
"adActiveDuration": "سيبقى إعلانك نشطًا لمدة {} يومًا، وبعد ذلك ستحتاج إلى تمديده ليبقى نشطًا.",
"discountOff": "خصم {} ٪"
} }

@ -919,5 +919,11 @@
"pleaseWait": "Please wait...", "pleaseWait": "Please wait...",
"numberOfShipping": "Number of Shipping", "numberOfShipping": "Number of Shipping",
"formatNeedsUpdate": "Ad format needs to be updated.", "formatNeedsUpdate": "Ad format needs to be updated.",
"noAdsMatchesYourSearch": "No Ads that matches your search" "noAdsMatchesYourSearch": "No Ads that matches your search",
"upgrade": "Upgrade",
"downgrade": "Downgrade",
"current": "Current",
"adActiveDuration": "Your Ad will be active for {} Days and then you will need to extend it to keep it active.",
"discountOff": "{} % OFF"
} }

@ -1049,18 +1049,33 @@ extension SubscriptionTypeEnumToInt on SubscriptionTypeEnum {
} }
} }
extension SubscriptionTypeEnumToString on SubscriptionTypeEnum { // extension SubscriptionTypeEnumToString on SubscriptionTypeEnum {
// String getStringSubscriptionTypeEnum() {
// switch (this) {
// case SubscriptionTypeEnum.current:
// return "Current";
// case SubscriptionTypeEnum.upgrade:
// return "Upgrade";
// case SubscriptionTypeEnum.downgrade:
// return "Downgrade";
//
// default:
// return "Current";
// }
// }
// }
extension SubscriptionTypeEnumExtension on SubscriptionTypeEnum {
String getStringSubscriptionTypeEnum() { String getStringSubscriptionTypeEnum() {
switch (this) { switch (this) {
case SubscriptionTypeEnum.current: case SubscriptionTypeEnum.current:
return "Current"; return LocaleKeys.current.tr();
case SubscriptionTypeEnum.upgrade: case SubscriptionTypeEnum.upgrade:
return "Upgrade"; return LocaleKeys.upgrade.tr();
case SubscriptionTypeEnum.downgrade:
return "Downgrade";
default: case SubscriptionTypeEnum.downgrade:
return "Current"; return LocaleKeys.downgrade.tr();
} }
} }
} }

@ -616,7 +616,7 @@ class CodegenLoader extends AssetLoader{
"requestAlreadyInProgress": "هذا الطلب قيد التقدم بالفعل.", "requestAlreadyInProgress": "هذا الطلب قيد التقدم بالفعل.",
"acceptOfferConfirmation": "هل تريد قبول هذا العرض؟", "acceptOfferConfirmation": "هل تريد قبول هذا العرض؟",
"acceptOfferConfirmationMessage": "سيتم قبول هذا العرض وستدفع المبلغ المطلوب للمشتري في وقت معين وإلا سيتم إلغاء هذا العرض.", "acceptOfferConfirmationMessage": "سيتم قبول هذا العرض وستدفع المبلغ المطلوب للمشتري في وقت معين وإلا سيتم إلغاء هذا العرض.",
"noUpcomingAppointments": "لا مواعيد قادم..", "noUpcomingAppointments": "لا توجد مواعيد قادمه..",
"addNewAppointment": "إضافة موعد جديد", "addNewAppointment": "إضافة موعد جديد",
"myNearbyBranches": "فروعي القريبة", "myNearbyBranches": "فروعي القريبة",
"myRecentBranches": "فروعي الأخيرة", "myRecentBranches": "فروعي الأخيرة",
@ -935,7 +935,14 @@ class CodegenLoader extends AssetLoader{
"numberOfShipping": "عدد الشحنات", "numberOfShipping": "عدد الشحنات",
"loading": "جار التحميل...", "loading": "جار التحميل...",
"pleaseSelectAccidentFree": "يرجى تحديد ما إذا كانت المركبة خالية من الحوادث", "pleaseSelectAccidentFree": "يرجى تحديد ما إذا كانت المركبة خالية من الحوادث",
"pleaseSelectMileageIncrease": "يرجى تحديد ما إذا كان يمكن زيادة المسافة المقطوعة" "pleaseSelectMileageIncrease": "يرجى تحديد ما إذا كان يمكن زيادة المسافة المقطوعة",
"formatNeedsUpdate": "تنسيق الاعلان يحتاج الى تحديث",
"noAdsMatchesYourSearch": "لا توجد اعلانات تطابق بحثك",
"upgrade": "ترقية",
"downgrade": "تخفيض الباقة",
"current": "الحالية",
"adActiveDuration": "سيبقى إعلانك نشطًا لمدة {} يومًا، وبعد ذلك ستحتاج إلى تمديده ليبقى نشطًا.",
"discountOff": "خصم {} ٪"
}; };
static const Map<String,dynamic> _en_US = { static const Map<String,dynamic> _en_US = {
"firstTimeLogIn": "First Time Log In", "firstTimeLogIn": "First Time Log In",
@ -1856,7 +1863,14 @@ static const Map<String,dynamic> _en_US = {
"androidApp": "Android", "androidApp": "Android",
"iosApp": "iOS", "iosApp": "iOS",
"pleaseWait": "Please wait...", "pleaseWait": "Please wait...",
"numberOfShipping": "Number of Shipping" "numberOfShipping": "Number of Shipping",
"formatNeedsUpdate": "Ad format needs to be updated.",
"noAdsMatchesYourSearch": "No Ads that matches your search",
"upgrade": "Upgrade",
"downgrade": "Downgrade",
"current": "Current",
"adActiveDuration": "Your Ad will be active for {} Days and then you will need to extend it to keep it active.",
"discountOff": "{} % OFF"
}; };
static const Map<String, Map<String,dynamic>> mapLocales = {"ar_SA": _ar_SA, "en_US": _en_US}; static const Map<String, Map<String,dynamic>> mapLocales = {"ar_SA": _ar_SA, "en_US": _en_US};
} }

@ -903,5 +903,10 @@ abstract class LocaleKeys {
static const pleaseSelectMileageIncrease = 'pleaseSelectMileageIncrease'; static const pleaseSelectMileageIncrease = 'pleaseSelectMileageIncrease';
static const formatNeedsUpdate = 'formatNeedsUpdate'; static const formatNeedsUpdate = 'formatNeedsUpdate';
static const noAdsMatchesYourSearch = 'noAdsMatchesYourSearch'; static const noAdsMatchesYourSearch = 'noAdsMatchesYourSearch';
static const upgrade = 'upgrade';
static const downgrade = 'downgrade';
static const current = 'current';
static const adActiveDuration = 'adActiveDuration';
static const discountOff = 'discountOff';
} }

@ -7,6 +7,8 @@ class AdsDurationModel {
bool? isActive; bool? isActive;
String? countryName; String? countryName;
String? currency; String? currency;
String? countryNameN;
String? currencyN;
double? discountValue; double? discountValue;
double? discountPercent; double? discountPercent;
double? priceAfterDiscount; double? priceAfterDiscount;
@ -22,6 +24,8 @@ class AdsDurationModel {
this.isActive, this.isActive,
this.countryName, this.countryName,
this.currency, this.currency,
this.countryNameN,
this.currencyN,
this.discountValue, this.discountValue,
this.discountPercent, this.discountPercent,
this.priceAfterDiscount, this.priceAfterDiscount,
@ -38,6 +42,8 @@ class AdsDurationModel {
isActive = json['isActive']; isActive = json['isActive'];
countryName = json['countryName']; countryName = json['countryName'];
currency = json['currency']; currency = json['currency'];
countryNameN = json['countryNameN'];
currencyN = json['currencyN'];
discountValue = json['discountValue']; discountValue = json['discountValue'];
discountPercent = json['discountPercent']; discountPercent = json['discountPercent'];
priceAfterDiscount = json['priceAfterDiscount']; priceAfterDiscount = json['priceAfterDiscount'];
@ -55,6 +61,8 @@ class AdsDurationModel {
data['isActive'] = isActive; data['isActive'] = isActive;
data['countryName'] = countryName; data['countryName'] = countryName;
data['currency'] = currency; data['currency'] = currency;
data['countryNameN'] = countryNameN;
data['currencyN'] = currencyN;
data['discountValue'] = discountValue; data['discountValue'] = discountValue;
data['discountPercent'] = discountPercent; data['discountPercent'] = discountPercent;
data['priceAfterDiscount'] = priceAfterDiscount; data['priceAfterDiscount'] = priceAfterDiscount;

@ -17,6 +17,7 @@ class SelectionModel {
String errorValue; String errorValue;
String itemPrice; String itemPrice;
String currency; String currency;
String currencyN;
SelectionModel({ SelectionModel({
this.selectedOption = "", this.selectedOption = "",
@ -24,11 +25,12 @@ class SelectionModel {
this.selectedId = 0, this.selectedId = 0,
this.itemPrice = "", this.itemPrice = "",
this.currency = "", this.currency = "",
this.currencyN = "",
}); });
@override @override
String toString() { String toString() {
return 'SelectionModel{selectedOption: $selectedOption, selectedId: $selectedId, errorValue: $errorValue, itemPrice: $itemPrice, currency: $currency}'; return 'SelectionModel{selectedOption: $selectedOption, selectedId: $selectedId, errorValue: $errorValue, itemPrice: $itemPrice, currency: $currency, currencyN: $currencyN}';
} }
} }

@ -33,6 +33,7 @@ class BranchDetailModel {
bool isExpanded = false; bool isExpanded = false;
bool? isFavorite; bool? isFavorite;
String? cityNameN; String? cityNameN;
String? countryNameN;
BranchDetailModel({ BranchDetailModel({
@ -64,6 +65,7 @@ class BranchDetailModel {
this.isFavorite, this.isFavorite,
required this.isExpanded, required this.isExpanded,
this.cityNameN, this.cityNameN,
this.countryNameN,
}); });
List<GenericImageModel> populateBranchImages(value) { List<GenericImageModel> populateBranchImages(value) {
@ -109,6 +111,7 @@ class BranchDetailModel {
isExpanded = false; isExpanded = false;
isFavorite = false; isFavorite = false;
cityNameN = json["cityNameN"]; cityNameN = json["cityNameN"];
countryNameN = json["countryNameN"];
} }
} }

@ -7,6 +7,7 @@ class ServiceModel {
final dynamic providerServiceDescription; final dynamic providerServiceDescription;
final int? categoryId; final int? categoryId;
final String? categoryName; final String? categoryName;
final String? categoryNameN;
final int? serviceId; final int? serviceId;
final String? serviceDescription; final String? serviceDescription;
final String? serviceDescriptionN; final String? serviceDescriptionN;
@ -32,6 +33,7 @@ class ServiceModel {
this.providerServiceDescription, this.providerServiceDescription,
this.categoryId, this.categoryId,
this.categoryName, this.categoryName,
this.categoryNameN,
this.serviceId, this.serviceId,
this.serviceDescription, this.serviceDescription,
this.serviceDescriptionN, this.serviceDescriptionN,
@ -58,6 +60,7 @@ class ServiceModel {
providerServiceDescription: json["providerServiceDescription"], providerServiceDescription: json["providerServiceDescription"],
categoryId: json["categoryID"], categoryId: json["categoryID"],
categoryName: json["categoryName"], categoryName: json["categoryName"],
categoryNameN: json["categoryNameN"],
serviceId: json["serviceID"], serviceId: json["serviceID"],
serviceDescription: json["serviceDescription"] ?? json["serviceName"], serviceDescription: json["serviceDescription"] ?? json["serviceName"],
serviceDescriptionN: json["serviceDescriptionN"] ?? json["serviceNameN"], serviceDescriptionN: json["serviceDescriptionN"] ?? json["serviceNameN"],
@ -89,6 +92,7 @@ class ServiceModel {
"providerServiceDescription": providerServiceDescription, "providerServiceDescription": providerServiceDescription,
"categoryID": categoryId, "categoryID": categoryId,
"categoryName": categoryName, "categoryName": categoryName,
"categoryNameN": categoryNameN,
"serviceID": serviceId, "serviceID": serviceId,
"serviceDescription": serviceDescription, "serviceDescription": serviceDescription,
"serviceDescriptionN": serviceDescriptionN, "serviceDescriptionN": serviceDescriptionN,

@ -517,7 +517,7 @@ class BranchRepoImp implements BranchRepo {
} }
GenericRespModel adsGenericModel = GenericRespModel adsGenericModel =
await apiClient.getJsonForObject((json) => GenericRespModel.fromJson(json), ApiConsts.branchesAndServices, token: appState.getUser.data!.accessToken, queryParameters: postParams); await apiClient.getJsonForObject((json) => GenericRespModel.fromJson(json), ApiConsts.branchesAndServices, token: appState.getUser.data!.accessToken, queryParameters: postParams);
print("branchesAndServices response ===== ${adsGenericModel.data}");
return ProviderProfileModel.fromJson(adsGenericModel.data); return ProviderProfileModel.fromJson(adsGenericModel.data);
} }

@ -1523,10 +1523,13 @@ class AdVM extends BaseVM {
} }
void showSaveAsDraftConfirmationDialog(BuildContext context, {required VoidCallback onYes, required VoidCallback onNo}) { void showSaveAsDraftConfirmationDialog(BuildContext context, {required VoidCallback onYes, required VoidCallback onNo}) {
final isArabic = AppState().isArabic(context);
actionConfirmationBottomSheet( actionConfirmationBottomSheet(
context: context, context: context,
title: "Save As Draft".toText(fontSize: 28, isBold: true, letterSpacing: -1.44), title:( isArabic ? "حفظ كمسودة" : "Save As Draft").toText(fontSize: 28, isBold: true, letterSpacing: -1.44),
subtitle: "Your ad will be saved as draft and you can continue later from where you left off. Do you want to save and go back?", subtitle: isArabic
? "سيتم حفظ إعلانك كمسودة، ويمكنك المتابعة لاحقًا من حيث توقفت. هل تريد الحفظ والرجوع؟"
: "Your ad will be saved as draft and you can continue later from where you left off. Do you want to save and go back?",
actionButtonYes: Expanded( actionButtonYes: Expanded(
child: ShowFillButton( child: ShowFillButton(
maxHeight: 55, maxHeight: 55,
@ -2966,6 +2969,7 @@ class AdVM extends BaseVM {
selectedOption: "${vehicleAdsDurations[index].days} Days", selectedOption: "${vehicleAdsDurations[index].days} Days",
itemPrice: vehicleAdsDurations[index].price!.toString(), itemPrice: vehicleAdsDurations[index].price!.toString(),
currency: vehicleAdsDurations[index].currency!.toString(), currency: vehicleAdsDurations[index].currency!.toString(),
currencyN: vehicleAdsDurations[index].currencyN!.toString(),
), ),
); );
} }

@ -251,6 +251,7 @@ class AppointmentsVM extends BaseVM {
void updateProviderCategoryId(SelectionModel id) { void updateProviderCategoryId(SelectionModel id) {
branchSelectedCategoryId = id; branchSelectedCategoryId = id;
getBranchServices(categoryId: branchSelectedCategoryId.selectedId); getBranchServices(categoryId: branchSelectedCategoryId.selectedId);
print(branchSelectedCategoryId.selectedOption);
notifyListeners(); notifyListeners();
} }
@ -1133,8 +1134,14 @@ class AppointmentsVM extends BaseVM {
void getBranchCategories() async { void getBranchCategories() async {
for (var value in selectedBranchModel!.branchServices!) { for (var value in selectedBranchModel!.branchServices!) {
if (!isCategoryAlreadyPresent(value.categoryId!)) { if (!isCategoryAlreadyPresent(value.categoryId!)) {
branchCategories.add(DropValue(value.categoryId!, value.categoryName!, "")); branchCategories.add(DropValue(value.categoryId!, value.categoryName!, value.categoryNameN ?? ""));
} }
print("branch ===== $value");
print("categoryId ===== ${value.categoryId}");
print("categoryName ===== ${value.categoryName}");
print("categoryNameN ===== ${value.categoryNameN}");
print("serviceDescription ===== ${value.serviceDescription}");
print("serviceDescriptionN ===== ${value.serviceDescriptionN}");
} }
notifyListeners(); notifyListeners();
} }

@ -992,3 +992,4 @@ class ServiceVM extends BaseVM {
} }
} }
} }

@ -80,7 +80,7 @@ class VehicleDetailsReview extends StatelessWidget {
16.height, 16.height,
SingleDetailWidget(text: adVM.isAccidentFree ? LocaleKeys.yes.tr() : LocaleKeys.no.tr(), type: LocaleKeys.accidentFree.tr()), SingleDetailWidget(text: adVM.isAccidentFree ? LocaleKeys.yes.tr() : LocaleKeys.no.tr(), type: LocaleKeys.accidentFree.tr()),
16.height, 16.height,
SingleDetailWidget(text: "${adVM.odometer} Km", type: LocaleKeys.odometer.tr()), SingleDetailWidget(text: "${adVM.odometer} ${LocaleKeys.km.tr()}", type: LocaleKeys.odometer.tr()),
16.height, 16.height,
SingleDetailWidget(text: adVM.vehicleVin, type: LocaleKeys.vehicleVIN.tr()), SingleDetailWidget(text: adVM.vehicleVin, type: LocaleKeys.vehicleVIN.tr()),
16.height, 16.height,

@ -93,6 +93,7 @@ class _AdsDetailViewState extends State<AdsDetailView> {
Widget buildVehicleDetailsWidget() { Widget buildVehicleDetailsWidget() {
bool isArabic = AppState().isArabic(context); bool isArabic = AppState().isArabic(context);
print("====================== ${widget.adDetails.vehicle!.currency }");
return Column( return Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -204,7 +205,12 @@ class _AdsDetailViewState extends State<AdsDetailView> {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
widget.adDetails.vehicle!.demandAmount!.toInt().toString().toText(fontSize: 30, height: 1.2, isBold: true), widget.adDetails.vehicle!.demandAmount!.toInt().toString().toText(fontSize: 30, height: 1.2, isBold: true),
(widget.adDetails.vehicle!.currency ?? LocaleKeys.sar.tr()).toText(fontSize: 15, color: MyColors.lightTextColor).paddingOnly(bottom: 5), // (widget.adDetails.vehicle!.currency ?? LocaleKeys.sar.tr()).toText(fontSize: 15, color: MyColors.lightTextColor).paddingOnly(bottom: 5),
( (isArabic ? widget.adDetails.vehicle!.currencyN : widget.adDetails.vehicle!.currency ) ?? '').toText(
fontSize: 15,
color: MyColors.lightTextColor,
)
.paddingOnly(bottom: 5),
], ],
), ),
if (widget.adDetails.adPostStatus == AdPostStatus.expired) ...[ if (widget.adDetails.adPostStatus == AdPostStatus.expired) ...[

@ -47,6 +47,7 @@ class AdDurationSelectionSheet extends StatelessWidget {
shrinkWrap: true, shrinkWrap: true,
itemCount: adVM.vehicleAdsDurations.length, itemCount: adVM.vehicleAdsDurations.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
bool isArabic = AppState().isArabic(context);
AdsDurationModel adDuration = adVM.vehicleAdsDurations[index]; AdsDurationModel adDuration = adVM.vehicleAdsDurations[index];
return SizedBox( return SizedBox(
width: double.infinity, width: double.infinity,
@ -61,10 +62,16 @@ class AdDurationSelectionSheet extends StatelessWidget {
children: [ children: [
("${adDuration.days} ${LocaleKeys.daysVar.tr()}").toString().toText(fontSize: 16, isBold: true), ("${adDuration.days} ${LocaleKeys.daysVar.tr()}").toString().toText(fontSize: 16, isBold: true),
4.height, 4.height,
"Your Ad will be active for ${adDuration.days} Days and then you will need to extend it to keep it active. ".toText( LocaleKeys.adActiveDuration
.tr(args: [adDuration.days.toString()])
.toText(
fontSize: 14, fontSize: 14,
color: MyColors.lightTextColor, color: MyColors.lightTextColor,
), ),
// "Your Ad will be active for ${adDuration.days} Days and then you will need to extend it to keep it active. ".toText(
// fontSize: 14,
// color: MyColors.lightTextColor,
// ),
12.height, 12.height,
LocaleKeys.adCharges.tr().toText(fontSize: 14, color: MyColors.lightTextColor, isBold: true), LocaleKeys.adCharges.tr().toText(fontSize: 14, color: MyColors.lightTextColor, isBold: true),
if (adDuration.discountPercent != null && adDuration.discountPercent! > 0.0) ...[ if (adDuration.discountPercent != null && adDuration.discountPercent! > 0.0) ...[
@ -83,18 +90,21 @@ class AdDurationSelectionSheet extends StatelessWidget {
2.width, 2.width,
Padding( Padding(
padding: const EdgeInsets.only(bottom: 4), padding: const EdgeInsets.only(bottom: 4),
child: (adDuration.currency ?? LocaleKeys.sar.tr()).toText(fontSize: 10, color: MyColors.lightTextColor, isBold: true), child: (isArabic ? adDuration.currencyN : adDuration.currency)?.toText(fontSize: 10, color: MyColors.lightTextColor, isBold: true)
), ),
14.width, 14.width,
"${adDuration.priceAfterDiscount}".toText(fontSize: 20, isBold: true), "${adDuration.priceAfterDiscount}".toText(fontSize: 20, isBold: true),
2.width, 2.width,
Padding( Padding(
padding: const EdgeInsets.only(bottom: 4), padding: const EdgeInsets.only(bottom: 4),
child: (adDuration.currency ?? LocaleKeys.sar.tr()).toText(fontSize: 10, color: MyColors.lightTextColor, isBold: true), // child: (adDuration.currency ?? LocaleKeys.sar.tr()).toText(fontSize: 10, color: MyColors.lightTextColor, isBold: true),
child: (isArabic ? adDuration.currencyN.toString() : adDuration.currency.toString()).toText(fontSize: 10, color: MyColors.lightTextColor, isBold: true),
), ),
], ],
), ),
"${adDuration.discountPercent} % OFF".toText(color: MyColors.white, fontSize: 10).toContainer(
//"${adDuration.discountPercent} % OFF"
LocaleKeys.discountOff.tr(args: [adDuration.discountPercent.toString()]).toText(color: MyColors.white, fontSize: 10).toContainer(
marginAll: 5, marginAll: 5,
paddingAll: 5, paddingAll: 5,
borderRadius: 4, borderRadius: 4,
@ -110,7 +120,7 @@ class AdDurationSelectionSheet extends StatelessWidget {
2.width, 2.width,
Padding( Padding(
padding: const EdgeInsets.only(bottom: 4), padding: const EdgeInsets.only(bottom: 4),
child: (adDuration.currency ?? LocaleKeys.sar.tr()).toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true), child: (isArabic ? adDuration.currencyN.toString() : adDuration.currency.toString()).toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true),
), ),
], ],
), ),
@ -142,7 +152,7 @@ class AdDurationSelectionSheet extends StatelessWidget {
selectedId: adDuration.id ?? 0, selectedId: adDuration.id ?? 0,
selectedOption: ("${adDuration.days} ${LocaleKeys.daysVar.tr()}"), selectedOption: ("${adDuration.days} ${LocaleKeys.daysVar.tr()}"),
itemPrice: adDuration.priceAfterDiscount!.toString(), itemPrice: adDuration.priceAfterDiscount!.toString(),
currency: adDuration.currency!.toString(), // currency: adDuration.currency!.toString(),
), ),
); );
}); });

@ -152,7 +152,7 @@ class SelectAdTypeView extends StatelessWidget {
2.width, 2.width,
Padding( Padding(
padding: const EdgeInsets.only(bottom: 4), padding: const EdgeInsets.only(bottom: 4),
child: adVM.vehicleAdDurationId.currency.toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true), child: (isArabic ? adVM.vehicleAdDurationId.currencyN : adVM.vehicleAdDurationId.currency).toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true),
), ),
], ],
), ),

@ -29,7 +29,9 @@ class AppointmentServicePickBottomSheet extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
bool isArabic = AppState().isArabic(context);
AppointmentsVM appointmentsVM = context.watch<AppointmentsVM>(); AppointmentsVM appointmentsVM = context.watch<AppointmentsVM>();
print("----------------- ${appointmentsVM.branchCategories.first}");
return SizedBox( return SizedBox(
height: MediaQuery.of(context).size.height * 0.85, height: MediaQuery.of(context).size.height * 0.85,
child: Column( child: Column(
@ -53,13 +55,58 @@ class AppointmentServicePickBottomSheet extends StatelessWidget {
children: [ children: [
Builder( Builder(
builder: (context) { builder: (context) {
print("isArabic ===== $isArabic");
for (var item in appointmentsVM.branchCategories) {
print("id ===== ${item.id}");
print("value English ===== ${item.value}");
print("valueN Arabic ===== ${item.valueN}");
print("subValue Price ===== ${item.subValue}");
print(
"Displayed ===== ${isArabic ? (item.valueN ?? item.value) : item.value}",
);
}
for (var item in appointmentsVM.branchCategories) {
print('id: ${item.id}');
print('value: ${item.value}');
print('subValue: ${item.subValue}');
print("valueN ${item.valueN}");
}
// return DropdownField(
// (DropValue value) => appointmentsVM.updateProviderCategoryId(SelectionModel(selectedId: value.id, selectedOption: value.value, itemPrice: value.subValue)),
// list: appointmentsVM.branchCategories,
// hint: LocaleKeys.selectCategory.tr(),
// dropdownValue: appointmentsVM.branchSelectedCategoryId.selectedId != -1
// ? DropValue(appointmentsVM.branchSelectedCategoryId.selectedId, appointmentsVM.branchSelectedCategoryId.selectedOption, "")
// : null,
// );
return DropdownField( return DropdownField(
(DropValue value) => appointmentsVM.updateProviderCategoryId(SelectionModel(selectedId: value.id, selectedOption: value.value, itemPrice: value.subValue)), (DropValue value) => appointmentsVM.updateProviderCategoryId(
SelectionModel(
selectedId: value.id,
selectedOption: isArabic
? (value.subValue ?? value.value)
: value.value,
),
),
list: appointmentsVM.branchCategories, list: appointmentsVM.branchCategories,
hint: LocaleKeys.selectCategory.tr(), hint: LocaleKeys.selectCategory.tr(),
dropdownValue: appointmentsVM.branchSelectedCategoryId.selectedId != -1 dropdownValue:
? DropValue(appointmentsVM.branchSelectedCategoryId.selectedId, appointmentsVM.branchSelectedCategoryId.selectedOption, "") appointmentsVM.branchSelectedCategoryId.selectedId != -1 &&
appointmentsVM.branchCategories.any(
(item) =>
item.id ==
appointmentsVM.branchSelectedCategoryId.selectedId,
)
? appointmentsVM.branchCategories.firstWhere(
(item) =>
item.id ==
appointmentsVM.branchSelectedCategoryId.selectedId,
)
: null, : null,
isArabic: isArabic,
useSubValueForArabic: true,
); );
}, },
), ),

@ -177,7 +177,7 @@ class AppointmentHomeTileWidget extends StatelessWidget {
children: [ children: [
!isForProvider ? MyAssets.miniClock.buildSvg(height: 12) : const SizedBox(), !isForProvider ? MyAssets.miniClock.buildSvg(height: 12) : const SizedBox(),
2.width, 2.width,
"${isForProvider ? LocaleKeys.apptOn.tr() : ""} ${appointmentListModel!.duration ?? ""} ${appointmentListModel!.appointmentDate!.toFormattedDateWithoutTime()}" "${isForProvider ? LocaleKeys.apptOn.tr() : ""} ${appointmentListModel!.duration ?? ""} ${appointmentListModel!.appointmentDate!.toLocalizedFormattedDateWithoutTime(context)}"
.toText(color: MyColors.lightTextColor, fontSize: 12, letterSpacing: -0.48, height: 19 / 12), .toText(color: MyColors.lightTextColor, fontSize: 12, letterSpacing: -0.48, height: 19 / 12),
], ],
), ),

@ -69,14 +69,29 @@ class CreateRequestPage extends StatelessWidget {
Builder(builder: (context) { Builder(builder: (context) {
List<DropValue> requestTypeDrop = []; List<DropValue> requestTypeDrop = [];
for (var element in requestsVM.myRequestsTypeEnum) { for (var element in requestsVM.myRequestsTypeEnum) {
requestTypeDrop.add(DropValue(element.enumValue.toInt() ?? 0, element.enumValueStr ?? "", "")); requestTypeDrop.add(DropValue(element.enumValue.toInt() ?? 0, element.enumValueStr ?? "", "",
valueN: element.enumValueStrN));
} }
print("languge====== ${context.locale.languageCode}");
return DropdownField( return DropdownField(
(DropValue value) => requestsVM.updateSelectionRequestTypeId(SelectionModel(selectedId: value.id, selectedOption: value.value)), (DropValue value
) {
print(
"========== REQUEST TYPE SELECTED ==========");
print("id: ${value.id}");
print("value: ${value.value}");
print("valueN: ${value.valueN}");
print("subValue: ${value.subValue}");
requestsVM.updateSelectionRequestTypeId(
SelectionModel(selectedId: value.id,
selectedOption: value.value));
},
list: requestTypeDrop, list: requestTypeDrop,
dropdownValue: requestsVM.requestTypeId.selectedId != -1 ? DropValue(requestsVM.requestTypeId.selectedId, requestsVM.requestTypeId.selectedOption, "") : null, dropdownValue: requestsVM.requestTypeId.selectedId != -1 ? DropValue(requestsVM.requestTypeId.selectedId, requestsVM.requestTypeId.selectedOption, "") : null,
hint: LocaleKeys.requestType.tr(), hint: LocaleKeys.requestType.tr(),
errorValue: requestsVM.requestTypeId.errorValue, errorValue: requestsVM.requestTypeId.errorValue,
isArabic: context.locale.languageCode == "ar",
useValueNForArabic: true,
); );
}), }),
], ],

Loading…
Cancel
Save