fatima_dev #7

Merged
FaizHashmiCS22 merged 4 commits from fatima_dev into master 4 weeks ago

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

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

@ -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 {

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

@ -214,6 +214,7 @@ class Vehicle {
String? countryName;
String? countryNameN;
String? currency;
String? currencyN;
int? odometer;
int? isInUsed;
bool? isAccidentFree;
@ -247,6 +248,7 @@ class Vehicle {
this.countryName,
this.countryNameN,
this.currency,
this.currencyN,
this.odometer,
this.isInUsed,
this.isAccidentFree});
@ -290,6 +292,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'];

@ -337,6 +337,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),

@ -49,7 +49,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(
@ -162,7 +162,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(),
],
),
),
@ -304,12 +305,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(
@ -343,7 +344,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,
@ -358,11 +360,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(),
],
),
],
@ -377,14 +383,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)

@ -141,6 +141,7 @@ class AppointmentHomeTileWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
bool isArabic = AppState().isArabic(context);
return Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -188,11 +189,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(
@ -205,11 +214,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,
// ),
],
)
],
@ -296,25 +313,59 @@ class AppointmentFragmentTileWidget extends StatelessWidget {
(appointmentListModel!.branchName ?? "").toText(color: MyColors.darkTextColor, fontSize: 12, letterSpacing: -0.48, height: 18 / 12),
],
),
// Row(
// children: [
// MyAssets.miniClock.buildSvg(height: 12),
// 2.width,
// " ${appointmentListModel!.duration ?? ""} ${appointmentListModel!.appointmentDate!.toFormattedDateWithoutTime()}".toText(color: MyColors.lightTextColor, fontSize: 12, letterSpacing: -0.48, height: 19 / 12),
// ],
// ),
Row(
children: [
MyAssets.miniClock.buildSvg(height: 12),
2.width,
" ${appointmentListModel!.duration ?? ""} ${appointmentListModel!.appointmentDate!.toFormattedDateWithoutTime()}".toText(color: MyColors.lightTextColor, fontSize: 12, letterSpacing: -0.48, height: 19 / 12),
" ${appointmentListModel!.duration ?? ""} ${appointmentListModel!.appointmentDate!.toLocalizedFormattedDateWithoutTime(context)}"
.toText(
color: MyColors.lightTextColor,
fontSize: 12,
letterSpacing: -0.48,
height: 19 / 12,
),
],
),
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)
)
],
),
),

@ -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