Merge branch 'fatima_dev' into faiz_development_common

faiz_development_common
FaizHashmi 3 hours ago
commit 10b8cf95a2

@ -931,6 +931,17 @@
"downgrade": "تخفيض الباقة",
"current": "الحالية",
"adActiveDuration": "سيبقى إعلانك نشطًا لمدة {} يومًا، وبعد ذلك ستحتاج إلى تمديده ليبقى نشطًا.",
"discountOff": "خصم {} ٪"
"discountOff": "خصم {} ٪",
"booked": "محجوز",
"confirmed": "مؤكد",
"rescheduled": "تمت إعادة الجدولة",
"upcoming": "قادم",
"workStarted": "بدأ العمل",
"past": "سابق",
"today": "اليوم",
"noAppointmentsMatchSearch": "لا توجد مواعيد تطابق بحثك",
"appts": "مواعيد",
"approvalPending": "بانتظار الموافقة",
"activateNow": "تفعيل الآن"
}

@ -929,6 +929,20 @@
"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"
"discountOff": "{} % OFF",
"booked": "Booked",
"confirmed": "Confirmed",
"rescheduled": "Rescheduled",
"upcoming": "Upcoming",
"workStarted": "Work Started",
"past": "Past",
"today": "Today",
"noAppointmentsMatchSearch": "No appointments that match your search",
"appts": "appts",
"approvalPending": "Approval Pending",
"activateNow": "Activate Now"
}

@ -159,10 +159,55 @@ extension FormatDate on String {
return "${dates[2]} ${getMonth(int.parse(dates[1]))} ${dates[0]} ${DateFormat('hh:mm a', "en_US").format(DateFormat('hh:mm:ss', "en_US").parse(time))}";
}
String toFormattedDateWithoutTime() {
// String toFormattedDateWithoutTime() {
// String date = split("T")[0];
// var dates = date.split("-");
// return "${dates[2]} ${getMonth(int.parse(dates[1]))}, ${dates[0]}";
// }
String toFormattedDateWithoutTime({bool isArabic = false}) {
String date = split("T")[0];
var dates = date.split("-");
return "${dates[2]} ${getMonth(int.parse(dates[1]))}, ${dates[0]}";
final monthNumber = int.parse(dates[1]);
final monthsEn = [
'',
'January',
'February',
'March',
'April',
'May',
'June',
'July',
'August',
'September',
'October',
'November',
'December',
];
final monthsAr = [
'',
'يناير',
'فبراير',
'مارس',
'أبريل',
'مايو',
'يونيو',
'يوليو',
'أغسطس',
'سبتمبر',
'أكتوبر',
'نوفمبر',
'ديسمبر',
];
final month = isArabic
? monthsAr[monthNumber]
: monthsEn[monthNumber];
return "${dates[2]} $month, ${dates[0]}";
}
String toLocalizedFormattedDateWithoutTime(BuildContext context) {
@ -358,41 +403,70 @@ extension AppointmentTypeEnumExtString on AppointmentTypeEnum {
}
}
// extension AppointmentStatusToString on AppointmentStatusEnum {
// String getAppointmentNameFromEnum() {
// switch (this) {
// case AppointmentStatusEnum.booked:
// return "Booked";
//
// case AppointmentStatusEnum.confirmed:
// return "Confirmed";
//
// case AppointmentStatusEnum.arrived:
// return "Arrived";
//
// case AppointmentStatusEnum.cancelled:
// return "Canceled";
//
// case AppointmentStatusEnum.rescheduled:
// return "Rescheduled";
//
// case AppointmentStatusEnum.upcoming:
// return "Upcoming";
//
// case AppointmentStatusEnum.workStarted:
// return "Work Started";
//
// case AppointmentStatusEnum.visitCompleted:
// return "Visit Completed";
//
// case AppointmentStatusEnum.past:
// return "Past";
//
// case AppointmentStatusEnum.today:
// return "Today";
//
// default:
// return "Booked";
// }
// }
// }
extension AppointmentStatusToString on AppointmentStatusEnum {
String getAppointmentNameFromEnum() {
switch (this) {
case AppointmentStatusEnum.booked:
return "Booked";
return LocaleKeys.booked.tr();
case AppointmentStatusEnum.confirmed:
return "Confirmed";
return LocaleKeys.confirmed.tr();
case AppointmentStatusEnum.arrived:
return "Arrived";
return LocaleKeys.arrived.tr();
case AppointmentStatusEnum.cancelled:
return "Canceled";
return LocaleKeys.canceled.tr();
case AppointmentStatusEnum.rescheduled:
return "Rescheduled";
return LocaleKeys.rescheduled.tr();
case AppointmentStatusEnum.upcoming:
return "Upcoming";
return LocaleKeys.upcoming.tr();
case AppointmentStatusEnum.workStarted:
return "Work Started";
return LocaleKeys.workStarted.tr();
case AppointmentStatusEnum.visitCompleted:
return "Visit Completed";
return LocaleKeys.visitCompleted.tr();
case AppointmentStatusEnum.past:
return "Past";
return LocaleKeys.past.tr();
case AppointmentStatusEnum.today:
return "Today";
return LocaleKeys.today.tr();
default:
return "Booked";
return LocaleKeys.booked.tr();
}
}
}

@ -947,7 +947,18 @@ class CodegenLoader extends AssetLoader{
"downgrade": "تخفيض الباقة",
"current": "الحالية",
"adActiveDuration": "سيبقى إعلانك نشطًا لمدة {} يومًا، وبعد ذلك ستحتاج إلى تمديده ليبقى نشطًا.",
"discountOff": "خصم {} ٪"
"discountOff": "خصم {} ٪",
"booked": "محجوز",
"confirmed": "مؤكد",
"rescheduled": "تمت إعادة الجدولة",
"upcoming": "قادم",
"workStarted": "بدأ العمل",
"past": "سابق",
"today": "اليوم",
"noAppointmentsMatchSearch": "لا توجد مواعيد تطابق بحثك",
"appts": "مواعيد",
"approvalPending": "بانتظار الموافقة",
"activateNow": "تفعيل الآن"
};
static const Map<String,dynamic> _en_US = {
"firstTimeLogIn": "First Time Log In",
@ -1880,7 +1891,18 @@ static const Map<String,dynamic> _en_US = {
"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"
"discountOff": "{} % OFF",
"booked": "Booked",
"confirmed": "Confirmed",
"rescheduled": "Rescheduled",
"upcoming": "Upcoming",
"workStarted": "Work Started",
"past": "Past",
"today": "Today",
"noAppointmentsMatchSearch": "No appointments that match your search",
"appts": "appts",
"approvalPending": "Approval Pending",
"activateNow": "Activate Now"
};
static const Map<String, Map<String,dynamic>> mapLocales = {"ar_SA": _ar_SA, "en_US": _en_US};
}

@ -913,5 +913,16 @@ abstract class LocaleKeys {
static const current = 'current';
static const adActiveDuration = 'adActiveDuration';
static const discountOff = 'discountOff';
static const booked = 'booked';
static const confirmed = 'confirmed';
static const rescheduled = 'rescheduled';
static const upcoming = 'upcoming';
static const workStarted = 'workStarted';
static const past = 'past';
static const today = 'today';
static const noAppointmentsMatchSearch = 'noAppointmentsMatchSearch';
static const appts = 'appts';
static const approvalPending = 'approvalPending';
static const activateNow = 'activateNow';
}

@ -172,7 +172,7 @@ class ServiceVM extends BaseVM {
CategoryData(
id: element.categoryId,
categoryName: element.categoryName,
categoryNameN: element.categoryName,
categoryNameN: element.categoryNameN,
),
);
}
@ -197,10 +197,10 @@ class ServiceVM extends BaseVM {
if (branchServiceEnums.isEmpty) {
branchServiceEnums = await commonRepo.getEnumTypeValues(enumTypeID: AppEnums.branchServicesEnumId);
}
branchServicesFilterOptions.clear();
for (int i = 0; i < branchServiceEnums.length; i++) {
branchServicesFilterOptions.add(FilterListModel(title: branchServiceEnums[i].enumValueStr, isSelected: false, id: branchServiceEnums[i].enumValue));
branchServicesFilterOptions.add(FilterListModel(title: branchServiceEnums[i].enumValueStr,
titleN: branchServiceEnums[i].enumValueStrN,isSelected: false, id: branchServiceEnums[i].enumValue));
}
}
@ -404,6 +404,7 @@ class ServiceVM extends BaseVM {
Future<void> getBranchAndServices() async {
setState(ViewState.busy);
branches = await branchRepo.getBranchAndServices();
if (branches!.data == null) {
homePageBranches = [];
} else if (branches!.data!.serviceProviderBranch == null) {

@ -294,7 +294,7 @@ class AppointmentDetailView extends StatelessWidget {
fit: BoxFit.fill,
),
5.width,
"${appointmentListModel.duration ?? ""} ${appointmentListModel.appointmentDate!.toFormattedDateWithoutTime()}".toText(fontSize: 12, isBold: true, color: MyColors.lightTextColor),
"${appointmentListModel.duration ?? ""} ${appointmentListModel.appointmentDate!.toFormattedDateWithoutTime( isArabic: context.locale.languageCode == 'ar',)}".toText(fontSize: 12, isBold: true, color: MyColors.lightTextColor),
],
),
13.height,

@ -135,7 +135,7 @@ class AppointmentHomeTileWidget extends StatelessWidget {
if (appointmentListModel.appointmentServicesList!.length > 1) {
servicesList.add(
showServices("+ ${appointmentListModel.appointmentServicesList!.length - 1} More", "", isMoreText: true),
showServices("+ ${appointmentListModel.appointmentServicesList!.length - 1} ${ LocaleKeys.more.tr() }", "", isMoreText: true),
);
}
return servicesList;
@ -285,7 +285,7 @@ class AppointmentFragmentTileWidget extends StatelessWidget {
if (appointmentListModel.appointmentServicesList!.length > 1) {
servicesList.add(
showServices("+ ${appointmentListModel.appointmentServicesList!.length - 1} More", "", isMoreText: true),
showServices("+ ${appointmentListModel.appointmentServicesList!.length - 1} ${ LocaleKeys.more.tr()}", "", isMoreText: true),
);
}
return servicesList;
@ -329,7 +329,7 @@ class AppointmentFragmentTileWidget extends StatelessWidget {
children: [
MyAssets.miniClock.buildSvg(height: 12),
2.width,
" ${appointmentListModel!.duration ?? ""} ${appointmentListModel!.appointmentDate!.toFormattedDateWithoutTime()}"
" ${appointmentListModel!.duration ?? ""} ${appointmentListModel!.appointmentDate!.toFormattedDateWithoutTime( isArabic: AppState().isArabic(context),)}"
.toText(color: MyColors.lightTextColor, fontSize: 12, letterSpacing: -0.48, height: 19 / 12),
],
),

@ -38,6 +38,10 @@ class FiltersList extends StatelessWidget {
itemCount: filterList.length,
scrollDirection: Axis.horizontal,
itemBuilder: (BuildContext context, int index) {
print("isArabic ===== $isArabic");
print("title EN ===== ${filterList[index].title}");
print("title AR ===== ${filterList[index].titleN}");
print("--------------------");
return InkWell(
onTap: () {
onFilterTapped(index, filterList[index].id);

Loading…
Cancel
Save