Merge branch 'master' into faiz_development_common

# Conflicts:
#	lib/views/appointments/widgets/common_appointment_slider_widget.dart
master
FaizHashmi 2 weeks ago
commit d59ae207d4

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

@ -917,5 +917,7 @@
"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"
} }

@ -164,6 +164,40 @@ extension FormatDate on String {
var dates = date.split("-"); var dates = date.split("-");
return "${dates[2]} ${getMonth(int.parse(dates[1]))}, ${dates[0]}"; 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 { extension RequestEnum on int {

@ -901,5 +901,7 @@ abstract class LocaleKeys {
static const loading = 'loading'; static const loading = 'loading';
static const pleaseSelectAccidentFree = 'pleaseSelectAccidentFree'; static const pleaseSelectAccidentFree = 'pleaseSelectAccidentFree';
static const pleaseSelectMileageIncrease = 'pleaseSelectMileageIncrease'; static const pleaseSelectMileageIncrease = 'pleaseSelectMileageIncrease';
static const formatNeedsUpdate = 'formatNeedsUpdate';
static const noAdsMatchesYourSearch = 'noAdsMatchesYourSearch';
} }

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

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

@ -51,7 +51,7 @@ class AdsListWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
const SizedBox(height: 25), 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) ...[ if (adVM.adsFiltersCounter > 0) ...[
const SizedBox(height: 16), const SizedBox(height: 16),
GestureDetector( GestureDetector(
@ -166,7 +166,8 @@ class _AdCardState extends State<AdCard> {
Expanded( Expanded(
child: Column( child: Column(
children: [ 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) ...[ else if (isAdsFragment && widget.adDetails.adPostStatus! == AdPostStatus.sold && widget.adDetails.statuslabel != null && widget.adDetails.statuslabel!.isNotEmpty) ...[
Padding( Padding(
padding: const EdgeInsets.only(top: 5), 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) ...[ ] else if (isAdsFragment && !context.read<AdVM>().isExploreAdsTapped && widget.adDetails.statuslabel != null && widget.adDetails.statuslabel!.isNotEmpty) ...[
Padding( Padding(
padding: const EdgeInsets.only(top: 5), 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( (widget.adDetails.vehicle!.vehicleTitle ?? "").toText(
@ -347,7 +348,8 @@ class _AdCardState extends State<AdCard> {
), ),
2.width, 2.width,
Expanded( 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, overflow: TextOverflow.ellipsis,
fontSize: 12, fontSize: 12,
letterSpacing: -0.48, letterSpacing: -0.48,
@ -362,11 +364,15 @@ class _AdCardState extends State<AdCard> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.start, 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: [ children: [
(widget.adDetails.vehicle!.cityName ?? "").toText(color: MyColors.lightTextColor, fontSize: 4), (isArabic ? widget.adDetails.vehicle!.cityNameN ?? "" : widget.adDetails.vehicle!.cityName ?? "").toText(color: MyColors.lightTextColor, fontSize: 4),
widget.adDetails.createdOn != null widget.adDetails.createdOn != null ? DateTime.parse(widget.adDetails.createdOn!).getTimeAgo(isArabic: context.locale.languageCode == 'ar',).toText(color: MyColors.lightTextColor, fontSize: 4) : const SizedBox(),
? DateTime.parse(widget.adDetails.createdOn!).getTimeAgo(isArabic: isArabic).toText(color: MyColors.lightTextColor, fontSize: 4)
: const SizedBox(),
], ],
), ),
], ],
@ -381,14 +387,17 @@ class _AdCardState extends State<AdCard> {
children: [ children: [
(widget.adDetails.vehicle!.demandAmount!.toInt().toString()).toText(fontSize: 19, isBold: true, letterSpacing: -1.16, height: 29 / 19), (widget.adDetails.vehicle!.demandAmount!.toInt().toString()).toText(fontSize: 19, isBold: true, letterSpacing: -1.16, height: 29 / 19),
2.width, 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( Transform.flip(
MyAssets.arrowRight, flipX: isArabic,
height: 9.69, child: SvgPicture.asset(
width: 13, MyAssets.arrowRight,
height: 9.69,
width: 13,
),
), ),
// const Icon(Icons.arrow_forward) // const Icon(Icons.arrow_forward)

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

@ -106,7 +106,7 @@ class _OfferListPageState extends State<OfferListPage> {
children: [ children: [
"${offersModel.companyName}".toText(color: MyColors.lightTextColor, fontSize: 14), "${offersModel.companyName}".toText(color: MyColors.lightTextColor, fontSize: 14),
if (offersModel.createdOn != null && offersModel.createdOn!.isNotEmpty) ...[ 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 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( .toText(
fontSize: 12, fontSize: 12,
isUnderLine: true, // isUnderLine: true,
color: MyColors.primaryColor, color: MyColors.primaryColor,
) ))
: showTrailingArrow : showTrailingArrow
? const Icon(Icons.arrow_forward, size: 18) ? const Icon(Icons.arrow_forward, size: 18)
: const SizedBox(), : const SizedBox(),

Loading…
Cancel
Save