Compare commits

...

10 Commits

Author SHA1 Message Date
FaizHashmi 944a09be60 Merge branch 'fatima_dev' into faiz_development_common
# Conflicts:
#	lib/widgets/dropdown/dropdow_field.dart
1 month ago
FaizHashmi d59ae207d4 Merge branch 'master' into faiz_development_common
# Conflicts:
#	lib/views/appointments/widgets/common_appointment_slider_widget.dart
1 month ago
Fatimah.Alshammari 3a75781abb fix issues with changing lang 1 month ago
Fatimah.Alshammari 01be7d9428 Merge branch 'master' into fatima_dev 2 months ago
Fatimah.Alshammari 1b187e6ee0 fix issues with changing lang 2 months ago
FaizHashmiCS22 4dddd656e1 Merge pull request 'fatima_dev' (#7) from fatima_dev into master
Reviewed-on: #7
2 months ago
Fatimah.Alshammari 6188dc493e Merge branch 'master' into fatima_dev
# Conflicts:
#	lib/views/advertisement/components/ads_list_widget.dart
2 months ago
Fatimah.Alshammari 8b393e9e27 update rbic UI and add arabic date formatting 2 months ago
Fatimah.Alshammari fdfbd244ab Merge remote-tracking branch 'origin/master' into fatima_dev
# Conflicts:
#	assets/langs/ar-SA.json
#	lib/generated/locale_keys.g.dart
2 months ago
Fatimah.Alshammari dacd452d47 fix Arabic issues 2 months ago

@ -600,7 +600,7 @@
"requestAlreadyInProgress": "هذا الطلب قيد التقدم بالفعل.",
"acceptOfferConfirmation": "هل تريد قبول هذا العرض؟",
"acceptOfferConfirmationMessage": "سيتم قبول هذا العرض وستدفع المبلغ المطلوب للمشتري في وقت معين وإلا سيتم إلغاء هذا العرض.",
"noUpcomingAppointments": "لا مواعيد قادم..",
"noUpcomingAppointments": "لا توجد مواعيد قادمه..",
"addNewAppointment": "إضافة موعد جديد",
"myNearbyBranches": "فروعي القريبة",
"myRecentBranches": "فروعي الأخيرة",
@ -919,5 +919,13 @@
"numberOfShipping": "عدد الشحنات",
"loading": "جار التحميل...",
"pleaseSelectAccidentFree": "يرجى تحديد ما إذا كانت المركبة خالية من الحوادث",
"pleaseSelectMileageIncrease": "يرجى تحديد ما إذا كان يمكن زيادة المسافة المقطوعة"
"pleaseSelectMileageIncrease": "يرجى تحديد ما إذا كان يمكن زيادة المسافة المقطوعة",
"formatNeedsUpdate": "تنسيق الاعلان يحتاج الى تحديث",
"noAdsMatchesYourSearch" :"لا توجد اعلانات تطابق بحثك",
"upgrade": "ترقية",
"downgrade": "تخفيض الباقة",
"current": "الحالية",
"adActiveDuration": "سيبقى إعلانك نشطًا لمدة {} يومًا، وبعد ذلك ستحتاج إلى تمديده ليبقى نشطًا.",
"discountOff": "خصم {} ٪"
}

@ -917,5 +917,13 @@
"androidApp": "Android",
"iosApp": "iOS",
"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"
}

@ -164,6 +164,40 @@ extension FormatDate on String {
var dates = date.split("-");
return "${dates[2]} ${getMonth(int.parse(dates[1]))}, ${dates[0]}";
}
String toLocalizedFormattedDateWithoutTime(BuildContext context) {
String date = split("T")[0];
var dates = date.split("-");
final isArabic =
Localizations.localeOf(context).languageCode == 'ar';
final month = isArabic
? getArabicMonth(int.parse(dates[1]))
: getMonth(int.parse(dates[1]));
return "${dates[2]} $month, ${dates[0]}";
}
String getArabicMonth(int month) {
const months = [
'',
'يناير',
'فبراير',
'مارس',
'أبريل',
'مايو',
'يونيو',
'يوليو',
'أغسطس',
'سبتمبر',
'أكتوبر',
'نوفمبر',
'ديسمبر',
];
return months[month];
}
}
extension RequestEnum on int {
@ -1015,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() {
switch (this) {
case SubscriptionTypeEnum.current:
return "Current";
return LocaleKeys.current.tr();
case SubscriptionTypeEnum.upgrade:
return "Upgrade";
case SubscriptionTypeEnum.downgrade:
return "Downgrade";
return LocaleKeys.upgrade.tr();
default:
return "Current";
case SubscriptionTypeEnum.downgrade:
return LocaleKeys.downgrade.tr();
}
}
}

@ -616,7 +616,7 @@ class CodegenLoader extends AssetLoader{
"requestAlreadyInProgress": "هذا الطلب قيد التقدم بالفعل.",
"acceptOfferConfirmation": "هل تريد قبول هذا العرض؟",
"acceptOfferConfirmationMessage": "سيتم قبول هذا العرض وستدفع المبلغ المطلوب للمشتري في وقت معين وإلا سيتم إلغاء هذا العرض.",
"noUpcomingAppointments": "لا مواعيد قادم..",
"noUpcomingAppointments": "لا توجد مواعيد قادمه..",
"addNewAppointment": "إضافة موعد جديد",
"myNearbyBranches": "فروعي القريبة",
"myRecentBranches": "فروعي الأخيرة",
@ -935,7 +935,14 @@ class CodegenLoader extends AssetLoader{
"numberOfShipping": "عدد الشحنات",
"loading": "جار التحميل...",
"pleaseSelectAccidentFree": "يرجى تحديد ما إذا كانت المركبة خالية من الحوادث",
"pleaseSelectMileageIncrease": "يرجى تحديد ما إذا كان يمكن زيادة المسافة المقطوعة"
"pleaseSelectMileageIncrease": "يرجى تحديد ما إذا كان يمكن زيادة المسافة المقطوعة",
"formatNeedsUpdate": "تنسيق الاعلان يحتاج الى تحديث",
"noAdsMatchesYourSearch": "لا توجد اعلانات تطابق بحثك",
"upgrade": "ترقية",
"downgrade": "تخفيض الباقة",
"current": "الحالية",
"adActiveDuration": "سيبقى إعلانك نشطًا لمدة {} يومًا، وبعد ذلك ستحتاج إلى تمديده ليبقى نشطًا.",
"discountOff": "خصم {} ٪"
};
static const Map<String,dynamic> _en_US = {
"firstTimeLogIn": "First Time Log In",
@ -1856,7 +1863,14 @@ static const Map<String,dynamic> _en_US = {
"androidApp": "Android",
"iosApp": "iOS",
"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};
}

@ -901,5 +901,12 @@ abstract class LocaleKeys {
static const loading = 'loading';
static const pleaseSelectAccidentFree = 'pleaseSelectAccidentFree';
static const pleaseSelectMileageIncrease = 'pleaseSelectMileageIncrease';
static const formatNeedsUpdate = 'formatNeedsUpdate';
static const noAdsMatchesYourSearch = 'noAdsMatchesYourSearch';
static const upgrade = 'upgrade';
static const downgrade = 'downgrade';
static const current = 'current';
static const adActiveDuration = 'adActiveDuration';
static const discountOff = 'discountOff';
}

@ -216,6 +216,7 @@ class Vehicle {
String? countryName;
String? countryNameN;
String? currency;
String? currencyN;
int? odometer;
int? isInUsed;
bool? isAccidentFree;
@ -249,6 +250,7 @@ class Vehicle {
this.countryName,
this.countryNameN,
this.currency,
this.currencyN,
this.odometer,
this.isInUsed,
this.isAccidentFree});
@ -292,6 +294,7 @@ class Vehicle {
countryName = json['countryName'];
countryNameN = json['countryNameN'] ?? json['countryName'];
currency = json['currency'];
currencyN = json['currencyN'];
odometer = json['odometer'];
isInUsed = json['isInUsed'];
isAccidentFree = json['isAccidentFree'];

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

@ -17,6 +17,7 @@ class SelectionModel {
String errorValue;
String itemPrice;
String currency;
String currencyN;
SelectionModel({
this.selectedOption = "",
@ -24,11 +25,12 @@ class SelectionModel {
this.selectedId = 0,
this.itemPrice = "",
this.currency = "",
this.currencyN = "",
});
@override
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? isFavorite;
String? cityNameN;
String? countryNameN;
BranchDetailModel({
@ -64,6 +65,7 @@ class BranchDetailModel {
this.isFavorite,
required this.isExpanded,
this.cityNameN,
this.countryNameN,
});
List<GenericImageModel> populateBranchImages(value) {
@ -109,6 +111,7 @@ class BranchDetailModel {
isExpanded = false;
isFavorite = false;
cityNameN = json["cityNameN"];
countryNameN = json["countryNameN"];
}
}

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

@ -340,6 +340,7 @@ class AdsRepoImp implements AdsRepo {
ApiConsts.getMyDraftAds,
queryParameters: draftAdsParams,
);
//print("ADS DATA = ${adsGenericModel.data}");
List<AdDetailsModel> vehicleAdsDetails = List.generate(
adsGenericModel.data.length,
(index) => AdDetailsModel.fromJson(adsGenericModel.data[index], true, adsGenericModel.totalItemsCount ?? 1),

@ -517,7 +517,7 @@ class BranchRepoImp implements BranchRepo {
}
GenericRespModel adsGenericModel =
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);
}

@ -1523,10 +1523,13 @@ class AdVM extends BaseVM {
}
void showSaveAsDraftConfirmationDialog(BuildContext context, {required VoidCallback onYes, required VoidCallback onNo}) {
final isArabic = AppState().isArabic(context);
actionConfirmationBottomSheet(
context: context,
title: "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?",
title:( isArabic ? "حفظ كمسودة" : "Save As Draft").toText(fontSize: 28, isBold: true, letterSpacing: -1.44),
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(
child: ShowFillButton(
maxHeight: 55,
@ -2966,6 +2969,7 @@ class AdVM extends BaseVM {
selectedOption: "${vehicleAdsDurations[index].days} Days",
itemPrice: vehicleAdsDurations[index].price!.toString(),
currency: vehicleAdsDurations[index].currency!.toString(),
currencyN: vehicleAdsDurations[index].currencyN!.toString(),
),
);
}

@ -251,6 +251,7 @@ class AppointmentsVM extends BaseVM {
void updateProviderCategoryId(SelectionModel id) {
branchSelectedCategoryId = id;
getBranchServices(categoryId: branchSelectedCategoryId.selectedId);
print(branchSelectedCategoryId.selectedOption);
notifyListeners();
}
@ -1133,8 +1134,14 @@ class AppointmentsVM extends BaseVM {
void getBranchCategories() async {
for (var value in selectedBranchModel!.branchServices!) {
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();
}

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

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

@ -93,6 +93,7 @@ class _AdsDetailViewState extends State<AdsDetailView> {
Widget buildVehicleDetailsWidget() {
bool isArabic = AppState().isArabic(context);
print("====================== ${widget.adDetails.vehicle!.currency }");
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
@ -204,7 +205,12 @@ class _AdsDetailViewState extends State<AdsDetailView> {
crossAxisAlignment: CrossAxisAlignment.end,
children: [
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) ...[

@ -47,6 +47,7 @@ class AdDurationSelectionSheet extends StatelessWidget {
shrinkWrap: true,
itemCount: adVM.vehicleAdsDurations.length,
itemBuilder: (BuildContext context, int index) {
bool isArabic = AppState().isArabic(context);
AdsDurationModel adDuration = adVM.vehicleAdsDurations[index];
return SizedBox(
width: double.infinity,
@ -61,10 +62,16 @@ class AdDurationSelectionSheet extends StatelessWidget {
children: [
("${adDuration.days} ${LocaleKeys.daysVar.tr()}").toString().toText(fontSize: 16, isBold: true),
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,
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,
LocaleKeys.adCharges.tr().toText(fontSize: 14, color: MyColors.lightTextColor, isBold: true),
if (adDuration.discountPercent != null && adDuration.discountPercent! > 0.0) ...[
@ -83,18 +90,21 @@ class AdDurationSelectionSheet extends StatelessWidget {
2.width,
Padding(
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,
"${adDuration.priceAfterDiscount}".toText(fontSize: 20, isBold: true),
2.width,
Padding(
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,
paddingAll: 5,
borderRadius: 4,
@ -110,7 +120,7 @@ class AdDurationSelectionSheet extends StatelessWidget {
2.width,
Padding(
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,
selectedOption: ("${adDuration.days} ${LocaleKeys.daysVar.tr()}"),
itemPrice: adDuration.priceAfterDiscount!.toString(),
currency: adDuration.currency!.toString(),
// currency: adDuration.currency!.toString(),
),
);
});

@ -51,7 +51,7 @@ class AdsListWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
const SizedBox(height: 25),
(adVM.adsFiltersCounter > 0 ? "No Ads that matches your search" : LocaleKeys.noAdsShow.tr()).toText(fontSize: 16, color: MyColors.lightTextColor, fontWeight: MyFonts.Medium),
(adVM.adsFiltersCounter > 0 ? LocaleKeys.noAdsMatchesYourSearch.tr() : LocaleKeys.noAdsShow.tr()).toText(fontSize: 16, color: MyColors.lightTextColor, fontWeight: MyFonts.Medium),
if (adVM.adsFiltersCounter > 0) ...[
const SizedBox(height: 16),
GestureDetector(
@ -166,7 +166,8 @@ class _AdCardState extends State<AdCard> {
Expanded(
child: Column(
children: [
"Ad format needs to be updated.".toText(),
LocaleKeys.formatNeedsUpdate.tr().toText(),
// "Ad format needs to be updated.".toText(),
],
),
),
@ -308,12 +309,12 @@ class _AdCardState extends State<AdCard> {
else if (isAdsFragment && widget.adDetails.adPostStatus! == AdPostStatus.sold && widget.adDetails.statuslabel != null && widget.adDetails.statuslabel!.isNotEmpty) ...[
Padding(
padding: const EdgeInsets.only(top: 5),
child: Utils.statusContainerChip(text: widget.adDetails.statuslabel ?? "", chipColor: Utils.getChipColorByAdStatus(widget.adDetails.adPostStatus!)),
child: Utils.statusContainerChip(text: isArabic ? widget.adDetails.statuslabelN ?? "": widget.adDetails.statuslabel ?? "", chipColor: Utils.getChipColorByAdStatus(widget.adDetails.adPostStatus!)),
),
] else if (isAdsFragment && !context.read<AdVM>().isExploreAdsTapped && widget.adDetails.statuslabel != null && widget.adDetails.statuslabel!.isNotEmpty) ...[
Padding(
padding: const EdgeInsets.only(top: 5),
child: Utils.statusContainerChip(text: widget.adDetails.statuslabel ?? "", chipColor: Utils.getChipColorByAdStatus(widget.adDetails.adPostStatus!)),
child: Utils.statusContainerChip(text: isArabic ? widget.adDetails.statuslabelN ?? "": widget.adDetails.statuslabel ?? "", chipColor: Utils.getChipColorByAdStatus(widget.adDetails.adPostStatus!)),
),
],
(widget.adDetails.vehicle!.vehicleTitle ?? "").toText(
@ -347,7 +348,8 @@ class _AdCardState extends State<AdCard> {
),
2.width,
Expanded(
child: "${widget.adDetails.vehicle?.mileage?.mileageStart ?? ""} - ${widget.adDetails.vehicle?.mileage?.mileageEnd ?? ""} km".toText(
child: "${widget.adDetails.vehicle?.mileage?.mileageStart ?? ""} - ${widget.adDetails.vehicle?.mileage?.mileageEnd ?? ""}"
"${LocaleKeys.km.tr()}".toText(
overflow: TextOverflow.ellipsis,
fontSize: 12,
letterSpacing: -0.48,
@ -362,11 +364,15 @@ class _AdCardState extends State<AdCard> {
Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.start,
// children: [
// (widget.adDetails.vehicle!.cityName ?? "").toText(color: MyColors.lightTextColor, fontSize: 4),
// widget.adDetails.createdOn != null
// ? DateTime.parse(widget.adDetails.createdOn!).getTimeAgo(isArabic: isArabic).toText(color: MyColors.lightTextColor, fontSize: 4)
// : const SizedBox(),
// ],
children: [
(widget.adDetails.vehicle!.cityName ?? "").toText(color: MyColors.lightTextColor, fontSize: 4),
widget.adDetails.createdOn != null
? DateTime.parse(widget.adDetails.createdOn!).getTimeAgo(isArabic: isArabic).toText(color: MyColors.lightTextColor, fontSize: 4)
: const SizedBox(),
(isArabic ? widget.adDetails.vehicle!.cityNameN ?? "" : widget.adDetails.vehicle!.cityName ?? "").toText(color: MyColors.lightTextColor, fontSize: 4),
widget.adDetails.createdOn != null ? DateTime.parse(widget.adDetails.createdOn!).getTimeAgo(isArabic: context.locale.languageCode == 'ar',).toText(color: MyColors.lightTextColor, fontSize: 4) : const SizedBox(),
],
),
],
@ -381,14 +387,17 @@ class _AdCardState extends State<AdCard> {
children: [
(widget.adDetails.vehicle!.demandAmount!.toInt().toString()).toText(fontSize: 19, isBold: true, letterSpacing: -1.16, height: 29 / 19),
2.width,
(widget.adDetails.vehicle!.currency ?? "").toText(color: MyColors.lightTextColor, fontSize: 10, letterSpacing: -0.4, height: 16 / 10).paddingOnly(bottom: 3),
(isArabic ? widget.adDetails.vehicle!.currencyN ?? "" : widget.adDetails.vehicle!.currency ?? "").toText(color: MyColors.lightTextColor, fontSize: 10, letterSpacing: -0.4, height: 16 / 10).paddingOnly(bottom: 3),
],
),
),
SvgPicture.asset(
MyAssets.arrowRight,
height: 9.69,
width: 13,
Transform.flip(
flipX: isArabic,
child: SvgPicture.asset(
MyAssets.arrowRight,
height: 9.69,
width: 13,
),
),
// const Icon(Icons.arrow_forward)

@ -152,7 +152,7 @@ class SelectAdTypeView extends StatelessWidget {
2.width,
Padding(
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
Widget build(BuildContext context) {
bool isArabic = AppState().isArabic(context);
AppointmentsVM appointmentsVM = context.watch<AppointmentsVM>();
print("----------------- ${appointmentsVM.branchCategories.first}");
return SizedBox(
height: MediaQuery.of(context).size.height * 0.85,
child: Column(
@ -53,13 +55,58 @@ class AppointmentServicePickBottomSheet extends StatelessWidget {
children: [
Builder(
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(
(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,
hint: LocaleKeys.selectCategory.tr(),
dropdownValue: appointmentsVM.branchSelectedCategoryId.selectedId != -1
? DropValue(appointmentsVM.branchSelectedCategoryId.selectedId, appointmentsVM.branchSelectedCategoryId.selectedOption, "")
dropdownValue:
appointmentsVM.branchSelectedCategoryId.selectedId != -1 &&
appointmentsVM.branchCategories.any(
(item) =>
item.id ==
appointmentsVM.branchSelectedCategoryId.selectedId,
)
? appointmentsVM.branchCategories.firstWhere(
(item) =>
item.id ==
appointmentsVM.branchSelectedCategoryId.selectedId,
)
: null,
isArabic: isArabic,
useSubValueForArabic: true,
);
},
),

@ -143,6 +143,7 @@ class AppointmentHomeTileWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
bool isArabic = AppState().isArabic(context);
return Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -176,7 +177,7 @@ class AppointmentHomeTileWidget extends StatelessWidget {
children: [
!isForProvider ? MyAssets.miniClock.buildSvg(height: 12) : const SizedBox(),
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),
],
),
@ -191,11 +192,19 @@ class AppointmentHomeTileWidget extends StatelessWidget {
),
),
//ic_arrow_right.svg
SvgPicture.asset(
MyAssets.arrowRight,
height: 9.69,
width: 13,
),
// SvgPicture.asset(
// MyAssets.arrowRight,
// height: 9.69,
// width: 13,
// ),
Transform.flip(
flipX: isArabic,
child: SvgPicture.asset(
MyAssets.arrowRight,
height: 9.69,
width: 13,
),
)
],
)
: Row(
@ -208,11 +217,19 @@ class AppointmentHomeTileWidget extends StatelessWidget {
fontSize: 14,
letterSpacing: -0.56,
),
SvgPicture.asset(
MyAssets.arrowRight,
height: 9.69,
width: 13,
),
Transform.flip(
flipX: isArabic,
child: SvgPicture.asset(
MyAssets.arrowRight,
height: 9.69,
width: 13,
),
)
// SvgPicture.asset(
// MyAssets.arrowRight,
// height: 9.69,
// width: 13,
// ),
],
)
],
@ -317,17 +334,38 @@ class AppointmentFragmentTileWidget extends StatelessWidget {
],
),
5.height,
// Row(
// crossAxisAlignment: CrossAxisAlignment.end,
// children: [
// Expanded(
// child: Column(
// children: buildServicesFromAppointment(appointmentListModel: appointmentListModel!),
// ),
// ),
// //ic_arrow_right.svg
// ],
// ).withArrow(context, isArrowEnabled: true)
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(
child: Column(
children: buildServicesFromAppointment(appointmentListModel: appointmentListModel!),
children: buildServicesFromAppointment(
appointmentListModel: appointmentListModel!,
),
),
),
Transform.flip(
flipX: AppState().isArabic(context),
child: SvgPicture.asset(
MyAssets.arrowRight,
height: 9.69,
width: 13,
),
),
//ic_arrow_right.svg
],
).withArrow(isArrowEnabled: true)
)
],
),
),

@ -69,14 +69,29 @@ class CreateRequestPage extends StatelessWidget {
Builder(builder: (context) {
List<DropValue> requestTypeDrop = [];
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(
(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,
dropdownValue: requestsVM.requestTypeId.selectedId != -1 ? DropValue(requestsVM.requestTypeId.selectedId, requestsVM.requestTypeId.selectedOption, "") : null,
hint: LocaleKeys.requestType.tr(),
errorValue: requestsVM.requestTypeId.errorValue,
isArabic: context.locale.languageCode == "ar",
useValueNForArabic: true,
);
}),
],

@ -106,7 +106,7 @@ class _OfferListPageState extends State<OfferListPage> {
children: [
"${offersModel.companyName}".toText(color: MyColors.lightTextColor, fontSize: 14),
if (offersModel.createdOn != null && offersModel.createdOn!.isNotEmpty) ...[
" | ${DateTime.parse(offersModel.createdOn!).getTimeAgo()}".toText(color: MyColors.lightTextColor, fontSize: 14),
" | ${DateTime.parse(offersModel.createdOn!).getTimeAgo(isArabic: context.locale.languageCode == 'ar')}".toText(color: MyColors.lightTextColor, fontSize: 14),
],
],
),

@ -59,12 +59,21 @@ class CustomSettingOptionsTile extends StatelessWidget {
],
),
isForLanguage
? (isArabic ? "English": "عربي")
? Container(
padding: const EdgeInsets.only(bottom: 2),
decoration: const BoxDecoration(
border: Border(
bottom: BorderSide(
color: MyColors.primaryColor,
width: 1)
)
),
child: (isArabic ? "English": "عربي")
.toText(
fontSize: 12,
isUnderLine: true,
// isUnderLine: true,
color: MyColors.primaryColor,
)
))
: showTrailingArrow
? const Icon(Icons.arrow_forward, size: 18)
: const SizedBox(),

Loading…
Cancel
Save