Merge branch 'localization_aamir' into faiz_development_common

# Conflicts:
#	lib/views/advertisement/ads_filter_view.dart
localization_aamir
Faiz Hashmi 2 years ago
commit e699b8f4a6

@ -328,7 +328,7 @@
"vehiclePart": "جزء المركبة", "vehiclePart": "جزء المركبة",
"damagePartPictures": "صور الأجزاء المتضررة", "damagePartPictures": "صور الأجزاء المتضررة",
"vehicleDamagePart": "جزء المركبة المتضرر", "vehicleDamagePart": "جزء المركبة المتضرر",
"duration": "المدة", "duration": ":المدة",
"specialServices": "الخدمات الخاصة", "specialServices": "الخدمات الخاصة",
"specialService": "خدمة خاصة", "specialService": "خدمة خاصة",
"adContactDetails": "تفاصيل الاتصال بالإعلان", "adContactDetails": "تفاصيل الاتصال بالإعلان",
@ -351,5 +351,169 @@
"demandAmount": "المبلغ المطلوب", "demandAmount": "المبلغ المطلوب",
"warrantyAvailableYears": "الضمان متاح (عدد السنوات)", "warrantyAvailableYears": "الضمان متاح (عدد السنوات)",
"vehicleDescription": "وصف المركبة", "vehicleDescription": "وصف المركبة",
"attachImage": "إرفاق صورة" "attachImage": "إرفاق صورة",
"useFingerPrintFaceID": "يرجى استخدام بصمة الإصبع أو معرف الوجه",
"setupTouchID": "يرجى إعداد معرف اللمس",
"reenableTouchID": "يرجى إعادة تمكين معرف اللمس",
"scanFaceIDAuthenticate": "امسح بصمة الإصبع أو معرف الوجه للتحقق",
"AdDeletedSuccessfully": "تم حذف الإعلان بنجاح!",
"yourReservationCancelled": "تم إلغاء حجزك.",
"adDeactivatedSuccessfully": "تم إلغاء تفعيل الإعلان بنجاح!",
"vehicle": {
"selectVehicleType": "يرجى اختيار نوع السيارة",
"selectVehicleModel": "يرجى اختيار طراز السيارة",
"selectVehicleModelYear": "يرجى اختيار سنة طراز السيارة",
"selectVehicleColor": "يرجى اختيار لون السيارة",
"vehicleCondition": "يرجى اختيار حالة السيارة",
"vehicleCategory": "يرجى اختيار فئة السيارة",
"vehicleMileage": "يرجى اختيار عدد أميال السيارة",
"vehicleTransmission": "يرجى اختيار نوع ناقل الحركة",
"vehicleSellerType": "يرجى اختيار نوع بائع السيارة",
"selectAny": "يرجى اختيار أي خيار",
"vehicleCity": "يرجى اختيار مدينة السيارة",
"vehiclePart": "يرجى اختيار جزء السيارة",
"selectValidVehicleType": "يرجى اختيار نوع سيارة صالح"
},
"selectAppointmentTimeService": "يجب عليك اختيار وقت الموعد للخدمة.",
"error": "خطأ",
"appointmentBookedSuccessfully": "تم حجز موعدك بنجاح",
"appointmentStatusUpdated": "تم تحديث حالة الموعد",
"paymentStatusUpdated": "تم تحديث حالة الدفع",
"selectOneSubService": "يرجى اختيار خدمة فرعية واحدة على الأقل",
"chargesBreakdown": "تفاصيل الرسوم",
"services": "الخدمات",
"homeLocation": "الموقع المنزلي",
"selectAppointmentTime": "يجب عليك اختيار وقت الموعد لكل موعد في الجدول",
"noAppointmentAvailable": "لا توجد مواعيد متاحة للعناصر المحددة",
"changedMind": "لقد غيرت رأيي",
"veryHighPrice": "السعر مرتفع جداً",
"alreadySold": "تم البيع بالفعل",
"otherVar": "أخرى",
"paymentSuccessful": "تم الدفع بنجاح",
"paymentFailed": "فشل الدفع!",
"requestSuccessfullyCreated": "تم إنشاء الطلب بنجاح",
"selectValidRequestType": "يرجى اختيار نوع طلب صالح",
"selectValidBrand": "يرجى اختيار علامة تجارية صالحة",
"selectValidModel": "يرجى اختيار طراز صالح",
"selectValidYear": "يرجى اختيار سنة صالحة",
"selectValidCountry": "يرجى اختيار بلد صالح",
"selectValidCity": "يرجى اختيار مدينة صالحة",
"addValidPrice": "يرجى إضافة سعر صالح",
"addValidDescription": "يرجى إضافة وصف صالح",
"passwordTooShort": "كلمة المرور الخاصة بك قصيرة جدًا",
"passwordAcceptableStrong": "كلمة المرور الخاصة بك مقبولة ولكنها ليست قوية",
"passwordIsStrong": "كلمة المرور الخاصة بك قوية",
"passwordVeryStrong": "كلمة المرور الخاصة بك قوية جدًا",
"selectDuration": "اختر المدة",
"daysVar": "الأيام",
"adCharges": "رسوم الإعلان",
"select": "اختر",
"deleteAdConfirmation": "هل تريد حذف الإعلان؟",
"deleteAdConfirmationMessage": "سيتم حذف إعلانك نهائيًا ولا يمكنك التراجع عن هذا الإجراء",
"mileage": "المسافة المقطوعة",
"transmission": "ناقل الحركة",
"demand": "الطلب",
"adDurationExpired": "انتهت مدة عرض الإعلان الخاص بك",
"bankDetails": "تفاصيل البنك",
"bankName": "اسم البنك",
"iban": "الرقم الدولي للحساب المصرفي (IBAN)",
"rejectionComments": "تعليقات الرفض",
"editAd": "تعديل الإعلان",
"reserveAd": "حجز الإعلان",
"reservationAmount": "مبلغ الحجز",
"belowAmountPayLater": "المبلغ الذي ستدفعه لاحقًا",
"carPrice": "سعر السيارة",
"vatExcluded": "القيمة المضافة غير مشمولة",
"carInsuranceService": "خدمة التأمين على السيارة",
"toBeDecided": "لم يتم اتخاذ القرار بعد",
"registrationCarPlates": "تسجيل ولوحات السيارة",
"homeDeliveryService": "خدمة التوصيل إلى المنزل",
"specialServicechargesInsuranceDeliveryLocation": "سيتم إضافة رسوم خدمة خاصة بناءً على التأمين المطلوب وموقع التسليم",
"estimated": "مقدر",
"servicesReservingAd": "بعض الخدمات إلزامية أثناء حجز الإعلان",
"completeReservation": "إتمام الحجز",
"contact": "اتصال",
"setDateandTime": "تحديد التاريخ والوقت",
"selectOffice": "اختيار المكتب",
"availableSlots": "المواعيد المتاحة",
"bookAndPay": "الحجز والدفع",
"reservationAmounts": "مبالغ الحجز",
"tax": "الضريبة",
"adsFilter": "تصفية الإعلانات",
"searchByCity": "البحث حسب المدينة",
"selectCity": "اختر المدينة",
"searchByBrandName": "البحث حسب اسم العلامة التجارية",
"selectVehicleBrand": "اختر علامة تجارية للسيارة",
"searchByVehicleYear": "البحث حسب سنة السيارة",
"selectYear": "اختر السنة",
"searchByAdOwner": "البحث حسب مالك الإعلان",
"selectOwner": "اختر المالك",
"search": "بحث",
"clearFilters": "مسح التصفية",
"book": "حجز",
"markAsSold": "وضع علامة تم البيع",
"deactivateAd": "إلغاء تفعيل الإعلان",
"doWantDeactivateAd": "هل تريد إلغاء تفعيل هذا الإعلان؟",
"stoptheBuyers": "سنتوقف عن عرض هذا الإعلان للمشترين",
"cancelReservation": "إلغاء الحجز",
"reasonForCancellation": "سبب الإلغاء",
"doWantCancelReservation": "هل تريد إلغاء الحجز؟",
"yourAdVisibletoBuy": "سيتم إلغاء حجز إعلانك وسيكون هذا الإعلان مرئيًا للجميع مرة أخرى للشراء",
"completeDeal": "إتمام الصفقة",
"uploadBankReceipt": "تحميل إيصال البنك",
"notesForAdmin": "ملاحظات للإدارة",
"extendAd": "تمديد الإعلان",
"updateAdDetails": "هل تريد تحديث تفاصيل الإعلان",
"durationExtendingAd": "يمكنك تغيير مدة الإعلان والتفاصيل قبل تمديد الإعلان",
"waitingAdminsResponse": "في انتظار رد الإدارة",
"cancelledByOwner": "ألغيت من قبل المالك",
"cancelledByAdmin": "ألغيت من قبل الإدارة",
"reservationTimeOver": "انتهى وقت الحجز",
"paymentVerified": "تم التحقق من الدفع",
"rejectedFormAdmin": "تم الرفض من قبل الإدارة",
"waitingAdminPost": "في انتظار الإدارة للنشر",
"waitingAdminsApproval": "في انتظار موافقة الإدارة",
"sold": "تم البيع",
"noAdsShow": "لا توجد إعلانات لعرضها",
"damagePartList": "قائمة الأجزاء المتضررة",
"searchPart": "البحث عن جزء",
"addSpecialService": "إضافة خدمة خاصة",
"vehicleVar": "السيارة",
"detailsVar": "التفاصيل",
"damageVar": "الضرر",
"partsVar": "الأجزاء",
"additional": "إضافي",
"review": "مراجعة",
"adVar": "الإعلان",
"updateAd": "تحديث الإعلان",
"createAd": "إنشاء إعلان",
"next": "التالي",
"submitAd": "إرسال الإعلان",
"selectAdType": "اختر نوع الإعلان",
"validUntilSubscriptionExpiration": "صالح حتى انتهاء الاشتراك",
"adsRemaining": "الإعلانات المتبقية",
"youLeftAdsGivenSubscription": "لقد بقي لديك 05 من 50 إعلانًا في الاشتراك.",
"updateSubscription": "تحديث الاشتراك",
"workInProgress": "العمل جارٍ",
"visitCompleted": "تمت الزيارة",
"youWantCancelAppointment": "هل تريد إلغاء هذا الموعد؟",
"appointmentCancelledCannotUndoAction": "سيتم إلغاء موعدك ولا يمكنك التراجع عن هذا الإجراء",
"appointment": "الموعد",
"rescheduleAppointment": "إعادة جدولة الموعد",
"payforAppointment": "دفع ثمن الموعد",
"appointmentsFilter": "تصفية المواعيد",
"searchByProvider": "البحث حسب المزود",
"selectProvider": "اختر المزود",
"searchByBranch": "البحث حسب الفرع",
"searchByCategory": "البحث حسب الفئة",
"selectCategory": "اختر الفئة",
"searchByService": "البحث حسب الخدمة",
"selectServices": "اختر الخدمات",
"modifyPackage": "تعديل الحزمة"
} }

@ -328,7 +328,7 @@
"vehiclePart": "Vehicle Part", "vehiclePart": "Vehicle Part",
"damagePartPictures": "Damage Part Pictures", "damagePartPictures": "Damage Part Pictures",
"vehicleDamagePart": "Vehicle Damage Part", "vehicleDamagePart": "Vehicle Damage Part",
"duration": "Duration", "duration": "Duration:",
"specialServices": "Special Services", "specialServices": "Special Services",
"specialService": "Special Service", "specialService": "Special Service",
"adContactDetails": "Ad Contact Details", "adContactDetails": "Ad Contact Details",
@ -351,6 +351,173 @@
"demandAmount": "Demand Amount", "demandAmount": "Demand Amount",
"warrantyAvailableYears": "Warranty Available (No. of Years)", "warrantyAvailableYears": "Warranty Available (No. of Years)",
"vehicleDescription": "Vehicle Description", "vehicleDescription": "Vehicle Description",
"attachImage": "Attach Image" "attachImage": "Attach Image",
"useFingerPrintFaceID": "Please use your fingerprint or face ID",
"setupTouchID": "Please set up your Touch ID",
"reenableTouchID": "Please reenable your Touch ID",
"scanFaceIDAuthenticate": "Scan your fingerprint or face ID to authenticate",
"adDeletedSuccessfully": "Ad has been deleted successfully!",
"yourReservationCancelled": "Your reservation has been cancelled.",
"adDeactivatedSuccessfully": "Ad has been deactivated successfully!",
"vehicle": {
"selectVehicleType": "Please select vehicle type",
"selectVehicleModel": "Please select vehicle model",
"selectVehicleModelYear": "Please select vehicle model year",
"selectVehicleColor": "Please select vehicle color",
"vehicleCondition": "Please select vehicle condition",
"vehicleCategory": "Please select vehicle category",
"vehicleMileage": "Please select vehicle Mileage",
"vehicleTransmission": "Please select vehicle transmission",
"vehicleSellerType": "Please select vehicle seller type",
"selectAny": "Please select any",
"vehicleCity": "Please select vehicle city",
"vehiclePart": "Please select vehicle part",
"selectValidVehicleType": "Please select valid Vehicle Type"
},
"selectAppointmentTimeService": "You must select appointment time the service.",
"error": "Error",
"appointmentBookedSuccessfully": "Your appointment has been booked successfully",
"appointmentStatusUpdated": "Appointment Status Updated",
"paymentStatusUpdated": "Payment Status Updated",
"selectOneSubService": "Please select at least one sub service",
"chargesBreakdown": "Charges Breakdown",
"services": "Services",
"homeLocation": "Home Location",
"selectAppointmentTime": "You must select appointment time for each schedule's appointment",
"noAppointmentAvailable": "There are no available appointments for selected Items",
"changedMind": "I have changed my mind",
"veryHighPrice": "Very High Price",
"alreadySold": "Already Sold",
"otherVar": "Other",
"paymentSuccessful": "Payment Successful",
"paymentFailed": "Payment Failed!",
"requestSuccessfullyCreated": "Request Successfully Created",
"selectValidRequestType": "Please select valid Request Type",
"selectValidBrand": "Please select valid Brand",
"selectValidModel": "Please select valid Model",
"selectValidYear": "Please select valid Year",
"selectValidCountry": "Please select valid Country",
"selectValidCity": "Please select valid City",
"addValidPrice": "Please add valid Price",
"addValidDescription": "Please add valid Description",
"passwordTooShort": "Your password is too short",
"passwordAcceptableStrong": "Your password is acceptable but not strong",
"passwordIsStrong": "Your password is strong",
"passwordVeryStrong": "Your password is very strong",
"onlyProviderApp": "Sorry, Only Customer's can log in this app",
"selectDuration": "Select Duration",
"daysVar": "Days",
"adCharges": "Ad Charges",
"select": "Select",
"deleteAdConfirmation": "Do you want to delete the ad?",
"deleteAdConfirmationMessage": "Your ad will be permanently deleted and you cannot undo this action",
"mileage": "mileage",
"transmission": "Transmission",
"demand": "Demand",
"adDurationExpired": "Your Ad Duration time is over",
"bankDetails": "Bank Details",
"bankName": "Bank Name",
"iban": "IBAN",
"rejectionComments": "Rejection Comments",
"editAd": "Edit Ad",
"reserveAd": "Reserve Ad",
"reservationAmount": "Reservation Amount",
"belowAmountPayLater": "Below Amount that you will pay later",
"carPrice":"Car Price",
"vatExcluded":"VAT Excluded",
"carInsuranceService":"Car insurance Service",
"toBeDecided":"To be Decided",
"registrationCarPlates":"Registration & Car Plates",
"homeDeliveryService":"Home Delivery Service",
"specialServicechargesInsuranceDeliveryLocation":"Special service charges will be added based on desired insurance and delivery Location",
"estimated":"Estimated",
"servicesReservingAd":"Some services are mandatory while reserving Ad",
"completeReservation":"Complete Reservation",
"contact":"Contact",
"setDateandTime":"Set Date and Time",
"selectOffice":"Select Office",
"availableSlots":"Available Slots",
"bookAndPay":"Book and Pay",
"reservationAmounts":"Reservation Amounts",
"tax":"Tax",
"adsFilter": "Ads Filter",
"searchByCity":"Search By City",
"selectCity":"Select City",
"searchByBrandName":"Search By Brand Name",
"selectVehicleBrand":"Select Vehicle Brand",
"searchByVehicleYear":"Search By Vehicle Year",
"selectYear":"Select Year",
"searchByAdOwner":"Search By Ad Owner",
"selectOwner":"Select Owner",
"search":"Search",
"clearFilters":"Clear Filters",
"book":"Book",
"markAsSold":"Mark As Sold",
"deactivateAd":"Deactivate Ad",
"doWantDeactivateAd":"Do you want to the Deactivate this Ad?",
"stoptheBuyers":"We will stop showing this ad to the buyers",
"cancelReservation":"Cancel Reservation",
"reasonForCancellation":"Reason for Cancellation",
"doWantCancelReservation":"Do you want to cancel the reservation",
"yourAdVisibletoBuy.":"Your ad reservation will be cancelled and this ad will be again visible to everyone to buy",
"completeDeal":"Complete Deal",
"uploadBankReceipt":"Upload Bank Receipt",
"notesForAdmin":"Notes For Admin",
"extendAd":"Extend Ad",
"updateAdDetails":"Do you want to update the Ad Details",
"durationExtendingAd":"You can change the ad duration and details before extending the ad",
"waitingAdminsResponse":"Waiting for Admins Response",
"cancelledByOwner":"Cancelled by Owner",
"cancelledByAdmin":"Cancelled by Admin",
"reservationTimeOver":"Reservation Time Over",
"paymentVerified":"Payment Verified",
"rejectedFormAdmin":"Rejected form Admin",
"waitingAdminPost":"Waiting for admin to post",
"waitingAdminsApproval":"Waiting for Admins Approval",
"sold":"Sold",
"noAdsShow":"No Ads to show",
"damagePartList":"Damage Part List",
"searchPart":"Search Part",
"addSpecialService":"Add Special Service",
"vehicleVar":"Vehicle",
"detailsVar":"Details",
"damageVar":"Damage",
"partsVar": "Parts",
"additional":"Additional",
"review":"Review",
"adVar": "Ad",
"updateAd":"Update Ad",
"createAd":"Create Ad",
"next":"Next",
"submitAd":"Submit Ad",
"selectAdType":"Select Ad Type",
"validUntilSubscriptionExpiration":"Valid Until Subscription Expiration",
"adsRemaining ":"Ads Remaining",
"youLeftAdsGivenSubscription":"You have left with 05 out of 50 ads given in the subscription.",
"updateSubscription":"Update Subscription",
"workInProgress":"Work In Progress",
"visitCompleted":"Visit Completed",
"youWantCancelAppointment":"Do you want to cancel this appointment?",
"appointmentCancelledCannotUndoAction":"Your appointment will be cancelled and you cannot undo this action.",
"appointment":"Appointment",
"rescheduleAppointment":"Reschedule Appointment",
"payforAppointment":"Pay for Appointment",
"appointmentsFilter":"Appointments Filter",
"searchByProvider":"Search By Provider",
"selectProvider":"Select Provider",
"searchByBranch":"Search By Branch",
"searchByCategory":"Search By Category",
"selectCategory":"Select Category",
"searchByService":"Search By Service",
"selectServices":"Select Services",
"modifyPackage": "Modify Package"
} }

@ -344,7 +344,7 @@ class CodegenLoader extends AssetLoader{
"vehiclePart": "جزء المركبة", "vehiclePart": "جزء المركبة",
"damagePartPictures": "صور الأجزاء المتضررة", "damagePartPictures": "صور الأجزاء المتضررة",
"vehicleDamagePart": "جزء المركبة المتضرر", "vehicleDamagePart": "جزء المركبة المتضرر",
"duration": "المدة", "duration": ":المدة",
"specialServices": "الخدمات الخاصة", "specialServices": "الخدمات الخاصة",
"specialService": "خدمة خاصة", "specialService": "خدمة خاصة",
"adContactDetails": "تفاصيل الاتصال بالإعلان", "adContactDetails": "تفاصيل الاتصال بالإعلان",
@ -367,7 +367,165 @@ class CodegenLoader extends AssetLoader{
"demandAmount": "المبلغ المطلوب", "demandAmount": "المبلغ المطلوب",
"warrantyAvailableYears": "الضمان متاح (عدد السنوات)", "warrantyAvailableYears": "الضمان متاح (عدد السنوات)",
"vehicleDescription": "وصف المركبة", "vehicleDescription": "وصف المركبة",
"attachImage": "إرفاق صورة" "attachImage": "إرفاق صورة",
"useFingerPrintFaceID": "يرجى استخدام بصمة الإصبع أو معرف الوجه",
"setupTouchID": "يرجى إعداد معرف اللمس",
"reenableTouchID": "يرجى إعادة تمكين معرف اللمس",
"scanFaceIDAuthenticate": "امسح بصمة الإصبع أو معرف الوجه للتحقق",
"AdDeletedSuccessfully": "تم حذف الإعلان بنجاح!",
"yourReservationCancelled": "تم إلغاء حجزك.",
"adDeactivatedSuccessfully": "تم إلغاء تفعيل الإعلان بنجاح!",
"vehicle": {
"selectVehicleType": "يرجى اختيار نوع السيارة",
"selectVehicleModel": "يرجى اختيار طراز السيارة",
"selectVehicleModelYear": "يرجى اختيار سنة طراز السيارة",
"selectVehicleColor": "يرجى اختيار لون السيارة",
"vehicleCondition": "يرجى اختيار حالة السيارة",
"vehicleCategory": "يرجى اختيار فئة السيارة",
"vehicleMileage": "يرجى اختيار عدد أميال السيارة",
"vehicleTransmission": "يرجى اختيار نوع ناقل الحركة",
"vehicleSellerType": "يرجى اختيار نوع بائع السيارة",
"selectAny": "يرجى اختيار أي خيار",
"vehicleCity": "يرجى اختيار مدينة السيارة",
"vehiclePart": "يرجى اختيار جزء السيارة",
"selectValidVehicleType": "يرجى اختيار نوع سيارة صالح"
},
"selectAppointmentTimeService": "يجب عليك اختيار وقت الموعد للخدمة.",
"error": "خطأ",
"appointmentBookedSuccessfully": "تم حجز موعدك بنجاح",
"appointmentStatusUpdated": "تم تحديث حالة الموعد",
"paymentStatusUpdated": "تم تحديث حالة الدفع",
"selectOneSubService": "يرجى اختيار خدمة فرعية واحدة على الأقل",
"chargesBreakdown": "تفاصيل الرسوم",
"services": "الخدمات",
"homeLocation": "الموقع المنزلي",
"selectAppointmentTime": "يجب عليك اختيار وقت الموعد لكل موعد في الجدول",
"noAppointmentAvailable": "لا توجد مواعيد متاحة للعناصر المحددة",
"changedMind": "لقد غيرت رأيي",
"veryHighPrice": "السعر مرتفع جداً",
"alreadySold": "تم البيع بالفعل",
"otherVar": "أخرى",
"paymentSuccessful": "تم الدفع بنجاح",
"paymentFailed": "فشل الدفع!",
"requestSuccessfullyCreated": "تم إنشاء الطلب بنجاح",
"selectValidRequestType": "يرجى اختيار نوع طلب صالح",
"selectValidBrand": "يرجى اختيار علامة تجارية صالحة",
"selectValidModel": "يرجى اختيار طراز صالح",
"selectValidYear": "يرجى اختيار سنة صالحة",
"selectValidCountry": "يرجى اختيار بلد صالح",
"selectValidCity": "يرجى اختيار مدينة صالحة",
"addValidPrice": "يرجى إضافة سعر صالح",
"addValidDescription": "يرجى إضافة وصف صالح",
"passwordTooShort": "كلمة المرور الخاصة بك قصيرة جدًا",
"passwordAcceptableStrong": "كلمة المرور الخاصة بك مقبولة ولكنها ليست قوية",
"passwordIsStrong": "كلمة المرور الخاصة بك قوية",
"passwordVeryStrong": "كلمة المرور الخاصة بك قوية جدًا",
"selectDuration": "اختر المدة",
"daysVar": "الأيام",
"adCharges": "رسوم الإعلان",
"select": "اختر",
"deleteAdConfirmation": "هل تريد حذف الإعلان؟",
"deleteAdConfirmationMessage": "سيتم حذف إعلانك نهائيًا ولا يمكنك التراجع عن هذا الإجراء",
"mileage": "المسافة المقطوعة",
"transmission": "ناقل الحركة",
"demand": "الطلب",
"adDurationExpired": "انتهت مدة عرض الإعلان الخاص بك",
"bankDetails": "تفاصيل البنك",
"bankName": "اسم البنك",
"iban": "الرقم الدولي للحساب المصرفي (IBAN)",
"rejectionComments": "تعليقات الرفض",
"editAd": "تعديل الإعلان",
"reserveAd": "حجز الإعلان",
"reservationAmount": "مبلغ الحجز",
"belowAmountPayLater": "المبلغ الذي ستدفعه لاحقًا",
"carPrice": "سعر السيارة",
"vatExcluded": "القيمة المضافة غير مشمولة",
"carInsuranceService": "خدمة التأمين على السيارة",
"toBeDecided": "لم يتم اتخاذ القرار بعد",
"registrationCarPlates": "تسجيل ولوحات السيارة",
"homeDeliveryService": "خدمة التوصيل إلى المنزل",
"specialServicechargesInsuranceDeliveryLocation": "سيتم إضافة رسوم خدمة خاصة بناءً على التأمين المطلوب وموقع التسليم",
"estimated": "مقدر",
"servicesReservingAd": "بعض الخدمات إلزامية أثناء حجز الإعلان",
"completeReservation": "إتمام الحجز",
"contact": "اتصال",
"setDateandTime": "تحديد التاريخ والوقت",
"selectOffice": "اختيار المكتب",
"availableSlots": "المواعيد المتاحة",
"bookAndPay": "الحجز والدفع",
"reservationAmounts": "مبالغ الحجز",
"tax": "الضريبة",
"adsFilter": "تصفية الإعلانات",
"searchByCity": "البحث حسب المدينة",
"selectCity": "اختر المدينة",
"searchByBrandName": "البحث حسب اسم العلامة التجارية",
"selectVehicleBrand": "اختر علامة تجارية للسيارة",
"searchByVehicleYear": "البحث حسب سنة السيارة",
"selectYear": "اختر السنة",
"searchByAdOwner": "البحث حسب مالك الإعلان",
"selectOwner": "اختر المالك",
"search": "بحث",
"clearFilters": "مسح التصفية",
"book": "حجز",
"markAsSold": "وضع علامة تم البيع",
"deactivateAd": "إلغاء تفعيل الإعلان",
"doWantDeactivateAd": "هل تريد إلغاء تفعيل هذا الإعلان؟",
"stoptheBuyers": "سنتوقف عن عرض هذا الإعلان للمشترين",
"cancelReservation": "إلغاء الحجز",
"reasonForCancellation": "سبب الإلغاء",
"doWantCancelReservation": "هل تريد إلغاء الحجز؟",
"yourAdVisibletoBuy": "سيتم إلغاء حجز إعلانك وسيكون هذا الإعلان مرئيًا للجميع مرة أخرى للشراء",
"completeDeal": "إتمام الصفقة",
"uploadBankReceipt": "تحميل إيصال البنك",
"notesForAdmin": "ملاحظات للإدارة",
"extendAd": "تمديد الإعلان",
"updateAdDetails": "هل تريد تحديث تفاصيل الإعلان",
"durationExtendingAd": "يمكنك تغيير مدة الإعلان والتفاصيل قبل تمديد الإعلان",
"waitingAdminsResponse": "في انتظار رد الإدارة",
"cancelledByOwner": "ألغيت من قبل المالك",
"cancelledByAdmin": "ألغيت من قبل الإدارة",
"reservationTimeOver": "انتهى وقت الحجز",
"paymentVerified": "تم التحقق من الدفع",
"rejectedFormAdmin": "تم الرفض من قبل الإدارة",
"waitingAdminPost": "في انتظار الإدارة للنشر",
"waitingAdminsApproval": "في انتظار موافقة الإدارة",
"sold": "تم البيع",
"noAdsShow": "لا توجد إعلانات لعرضها",
"damagePartList": "قائمة الأجزاء المتضررة",
"searchPart": "البحث عن جزء",
"addSpecialService": "إضافة خدمة خاصة",
"vehicleVar": "السيارة",
"detailsVar": "التفاصيل",
"damageVar": "الضرر",
"partsVar": "الأجزاء",
"additional": "إضافي",
"review": "مراجعة",
"adVar": "الإعلان",
"updateAd": "تحديث الإعلان",
"createAd": "إنشاء إعلان",
"next": "التالي",
"submitAd": "إرسال الإعلان",
"selectAdType": "اختر نوع الإعلان",
"validUntilSubscriptionExpiration": "صالح حتى انتهاء الاشتراك",
"adsRemaining": "الإعلانات المتبقية",
"youLeftAdsGivenSubscription": "لقد بقي لديك 05 من 50 إعلانًا في الاشتراك.",
"updateSubscription": "تحديث الاشتراك",
"workInProgress": "العمل جارٍ",
"visitCompleted": "تمت الزيارة",
"youWantCancelAppointment": "هل تريد إلغاء هذا الموعد؟",
"appointmentCancelledCannotUndoAction": "سيتم إلغاء موعدك ولا يمكنك التراجع عن هذا الإجراء",
"appointment": "الموعد",
"rescheduleAppointment": "إعادة جدولة الموعد",
"payforAppointment": "دفع ثمن الموعد",
"appointmentsFilter": "تصفية المواعيد",
"searchByProvider": "البحث حسب المزود",
"selectProvider": "اختر المزود",
"searchByBranch": "البحث حسب الفرع",
"searchByCategory": "البحث حسب الفئة",
"selectCategory": "اختر الفئة",
"searchByService": "البحث حسب الخدمة",
"selectServices": "اختر الخدمات",
"modifyPackage": "تعديل الحزمة"
}; };
static const Map<String,dynamic> en_US = { static const Map<String,dynamic> en_US = {
"firstTimeLogIn": "First Time Log In", "firstTimeLogIn": "First Time Log In",
@ -699,7 +857,7 @@ static const Map<String,dynamic> en_US = {
"vehiclePart": "Vehicle Part", "vehiclePart": "Vehicle Part",
"damagePartPictures": "Damage Part Pictures", "damagePartPictures": "Damage Part Pictures",
"vehicleDamagePart": "Vehicle Damage Part", "vehicleDamagePart": "Vehicle Damage Part",
"duration": "Duration", "duration": "Duration:",
"specialServices": "Special Services", "specialServices": "Special Services",
"specialService": "Special Service", "specialService": "Special Service",
"adContactDetails": "Ad Contact Details", "adContactDetails": "Ad Contact Details",
@ -722,7 +880,166 @@ static const Map<String,dynamic> en_US = {
"demandAmount": "Demand Amount", "demandAmount": "Demand Amount",
"warrantyAvailableYears": "Warranty Available (No. of Years)", "warrantyAvailableYears": "Warranty Available (No. of Years)",
"vehicleDescription": "Vehicle Description", "vehicleDescription": "Vehicle Description",
"attachImage": "Attach Image" "attachImage": "Attach Image",
"useFingerPrintFaceID": "Please use your fingerprint or face ID",
"setupTouchID": "Please set up your Touch ID",
"reenableTouchID": "Please reenable your Touch ID",
"scanFaceIDAuthenticate": "Scan your fingerprint or face ID to authenticate",
"adDeletedSuccessfully": "Ad has been deleted successfully!",
"yourReservationCancelled": "Your reservation has been cancelled.",
"adDeactivatedSuccessfully": "Ad has been deactivated successfully!",
"vehicle": {
"selectVehicleType": "Please select vehicle type",
"selectVehicleModel": "Please select vehicle model",
"selectVehicleModelYear": "Please select vehicle model year",
"selectVehicleColor": "Please select vehicle color",
"vehicleCondition": "Please select vehicle condition",
"vehicleCategory": "Please select vehicle category",
"vehicleMileage": "Please select vehicle Mileage",
"vehicleTransmission": "Please select vehicle transmission",
"vehicleSellerType": "Please select vehicle seller type",
"selectAny": "Please select any",
"vehicleCity": "Please select vehicle city",
"vehiclePart": "Please select vehicle part",
"selectValidVehicleType": "Please select valid Vehicle Type"
},
"selectAppointmentTimeService": "You must select appointment time the service.",
"error": "Error",
"appointmentBookedSuccessfully": "Your appointment has been booked successfully",
"appointmentStatusUpdated": "Appointment Status Updated",
"paymentStatusUpdated": "Payment Status Updated",
"selectOneSubService": "Please select at least one sub service",
"chargesBreakdown": "Charges Breakdown",
"services": "Services",
"homeLocation": "Home Location",
"selectAppointmentTime": "You must select appointment time for each schedule's appointment",
"noAppointmentAvailable": "There are no available appointments for selected Items",
"changedMind": "I have changed my mind",
"veryHighPrice": "Very High Price",
"alreadySold": "Already Sold",
"otherVar": "Other",
"paymentSuccessful": "Payment Successful",
"paymentFailed": "Payment Failed!",
"requestSuccessfullyCreated": "Request Successfully Created",
"selectValidRequestType": "Please select valid Request Type",
"selectValidBrand": "Please select valid Brand",
"selectValidModel": "Please select valid Model",
"selectValidYear": "Please select valid Year",
"selectValidCountry": "Please select valid Country",
"selectValidCity": "Please select valid City",
"addValidPrice": "Please add valid Price",
"addValidDescription": "Please add valid Description",
"passwordTooShort": "Your password is too short",
"passwordAcceptableStrong": "Your password is acceptable but not strong",
"passwordIsStrong": "Your password is strong",
"passwordVeryStrong": "Your password is very strong",
"onlyProviderApp": "Sorry, Only Customer's can log in this app",
"selectDuration": "Select Duration",
"daysVar": "Days",
"adCharges": "Ad Charges",
"select": "Select",
"deleteAdConfirmation": "Do you want to delete the ad?",
"deleteAdConfirmationMessage": "Your ad will be permanently deleted and you cannot undo this action",
"mileage": "mileage",
"transmission": "Transmission",
"demand": "Demand",
"adDurationExpired": "Your Ad Duration time is over",
"bankDetails": "Bank Details",
"bankName": "Bank Name",
"iban": "IBAN",
"rejectionComments": "Rejection Comments",
"editAd": "Edit Ad",
"reserveAd": "Reserve Ad",
"reservationAmount": "Reservation Amount",
"belowAmountPayLater": "Below Amount that you will pay later",
"carPrice": "Car Price",
"vatExcluded": "VAT Excluded",
"carInsuranceService": "Car insurance Service",
"toBeDecided": "To be Decided",
"registrationCarPlates": "Registration & Car Plates",
"homeDeliveryService": "Home Delivery Service",
"specialServicechargesInsuranceDeliveryLocation": "Special service charges will be added based on desired insurance and delivery Location",
"estimated": "Estimated",
"servicesReservingAd": "Some services are mandatory while reserving Ad",
"completeReservation": "Complete Reservation",
"contact": "Contact",
"setDateandTime": "Set Date and Time",
"selectOffice": "Select Office",
"availableSlots": "Available Slots",
"bookAndPay": "Book and Pay",
"reservationAmounts": "Reservation Amounts",
"tax": "Tax",
"adsFilter": "Ads Filter",
"searchByCity": "Search By City",
"selectCity": "Select City",
"searchByBrandName": "Search By Brand Name",
"selectVehicleBrand": "Select Vehicle Brand",
"searchByVehicleYear": "Search By Vehicle Year",
"selectYear": "Select Year",
"searchByAdOwner": "Search By Ad Owner",
"selectOwner": "Select Owner",
"search": "Search",
"clearFilters": "Clear Filters",
"book": "Book",
"markAsSold": "Mark As Sold",
"deactivateAd": "Deactivate Ad",
"doWantDeactivateAd": "Do you want to the Deactivate this Ad?",
"stoptheBuyers": "We will stop showing this ad to the buyers",
"cancelReservation": "Cancel Reservation",
"reasonForCancellation": "Reason for Cancellation",
"doWantCancelReservation": "Do you want to cancel the reservation",
"yourAdVisibletoBuy.": "Your ad reservation will be cancelled and this ad will be again visible to everyone to buy",
"completeDeal": "Complete Deal",
"uploadBankReceipt": "Upload Bank Receipt",
"notesForAdmin": "Notes For Admin",
"extendAd": "Extend Ad",
"updateAdDetails": "Do you want to update the Ad Details",
"durationExtendingAd": "You can change the ad duration and details before extending the ad",
"waitingAdminsResponse": "Waiting for Admins Response",
"cancelledByOwner": "Cancelled by Owner",
"cancelledByAdmin": "Cancelled by Admin",
"reservationTimeOver": "Reservation Time Over",
"paymentVerified": "Payment Verified",
"rejectedFormAdmin": "Rejected form Admin",
"waitingAdminPost": "Waiting for admin to post",
"waitingAdminsApproval": "Waiting for Admins Approval",
"sold": "Sold",
"noAdsShow": "No Ads to show",
"damagePartList": "Damage Part List",
"searchPart": "Search Part",
"addSpecialService": "Add Special Service",
"vehicleVar": "Vehicle",
"detailsVar": "Details",
"damageVar": "Damage",
"partsVar": "Parts",
"additional": "Additional",
"review": "Review",
"adVar": "Ad",
"updateAd": "Update Ad",
"createAd": "Create Ad",
"next": "Next",
"submitAd": "Submit Ad",
"selectAdType": "Select Ad Type",
"validUntilSubscriptionExpiration": "Valid Until Subscription Expiration",
"adsRemaining ": "Ads Remaining",
"youLeftAdsGivenSubscription": "You have left with 05 out of 50 ads given in the subscription.",
"updateSubscription": "Update Subscription",
"workInProgress": "Work In Progress",
"visitCompleted": "Visit Completed",
"youWantCancelAppointment": "Do you want to cancel this appointment?",
"appointmentCancelledCannotUndoAction": "Your appointment will be cancelled and you cannot undo this action.",
"appointment": "Appointment",
"rescheduleAppointment": "Reschedule Appointment",
"payforAppointment": "Pay for Appointment",
"appointmentsFilter": "Appointments Filter",
"searchByProvider": "Search By Provider",
"selectProvider": "Select Provider",
"searchByBranch": "Search By Branch",
"searchByCategory": "Search By Category",
"selectCategory": "Select Category",
"searchByService": "Search By Service",
"selectServices": "Select Services",
"modifyPackage": "Modify Package"
}; };
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};
} }

@ -332,5 +332,162 @@ abstract class LocaleKeys {
static const warrantyAvailableYears = 'warrantyAvailableYears'; static const warrantyAvailableYears = 'warrantyAvailableYears';
static const vehicleDescription = 'vehicleDescription'; static const vehicleDescription = 'vehicleDescription';
static const attachImage = 'attachImage'; static const attachImage = 'attachImage';
static const useFingerPrintFaceID = 'useFingerPrintFaceID';
static const setupTouchID = 'setupTouchID';
static const reenableTouchID = 'reenableTouchID';
static const scanFaceIDAuthenticate = 'scanFaceIDAuthenticate';
static const AdDeletedSuccessfully = 'AdDeletedSuccessfully';
static const yourReservationCancelled = 'yourReservationCancelled';
static const adDeactivatedSuccessfully = 'adDeactivatedSuccessfully';
static const vehicle_selectVehicleType = 'vehicle.selectVehicleType';
static const vehicle_selectVehicleModel = 'vehicle.selectVehicleModel';
static const vehicle_selectVehicleModelYear = 'vehicle.selectVehicleModelYear';
static const vehicle_selectVehicleColor = 'vehicle.selectVehicleColor';
static const vehicle_vehicleCondition = 'vehicle.vehicleCondition';
static const vehicle_vehicleCategory = 'vehicle.vehicleCategory';
static const vehicle_vehicleMileage = 'vehicle.vehicleMileage';
static const vehicle_vehicleTransmission = 'vehicle.vehicleTransmission';
static const vehicle_vehicleSellerType = 'vehicle.vehicleSellerType';
static const vehicle_selectAny = 'vehicle.selectAny';
static const vehicle_vehicleCity = 'vehicle.vehicleCity';
static const vehicle_vehiclePart = 'vehicle.vehiclePart';
static const vehicle_selectValidVehicleType = 'vehicle.selectValidVehicleType';
static const vehicle = 'vehicle';
static const selectAppointmentTimeService = 'selectAppointmentTimeService';
static const error = 'error';
static const appointmentBookedSuccessfully = 'appointmentBookedSuccessfully';
static const appointmentStatusUpdated = 'appointmentStatusUpdated';
static const paymentStatusUpdated = 'paymentStatusUpdated';
static const selectOneSubService = 'selectOneSubService';
static const chargesBreakdown = 'chargesBreakdown';
static const services = 'services';
static const homeLocation = 'homeLocation';
static const selectAppointmentTime = 'selectAppointmentTime';
static const noAppointmentAvailable = 'noAppointmentAvailable';
static const changedMind = 'changedMind';
static const veryHighPrice = 'veryHighPrice';
static const alreadySold = 'alreadySold';
static const otherVar = 'otherVar';
static const paymentSuccessful = 'paymentSuccessful';
static const paymentFailed = 'paymentFailed';
static const requestSuccessfullyCreated = 'requestSuccessfullyCreated';
static const selectValidRequestType = 'selectValidRequestType';
static const selectValidBrand = 'selectValidBrand';
static const selectValidModel = 'selectValidModel';
static const selectValidYear = 'selectValidYear';
static const selectValidCountry = 'selectValidCountry';
static const selectValidCity = 'selectValidCity';
static const addValidPrice = 'addValidPrice';
static const addValidDescription = 'addValidDescription';
static const passwordTooShort = 'passwordTooShort';
static const passwordAcceptableStrong = 'passwordAcceptableStrong';
static const passwordIsStrong = 'passwordIsStrong';
static const passwordVeryStrong = 'passwordVeryStrong';
static const selectDuration = 'selectDuration';
static const daysVar = 'daysVar';
static const adCharges = 'adCharges';
static const select = 'select';
static const deleteAdConfirmation = 'deleteAdConfirmation';
static const deleteAdConfirmationMessage = 'deleteAdConfirmationMessage';
static const mileage = 'mileage';
static const transmission = 'transmission';
static const demand = 'demand';
static const adDurationExpired = 'adDurationExpired';
static const bankDetails = 'bankDetails';
static const bankName = 'bankName';
static const iban = 'iban';
static const rejectionComments = 'rejectionComments';
static const editAd = 'editAd';
static const reserveAd = 'reserveAd';
static const reservationAmount = 'reservationAmount';
static const belowAmountPayLater = 'belowAmountPayLater';
static const carPrice = 'carPrice';
static const vatExcluded = 'vatExcluded';
static const carInsuranceService = 'carInsuranceService';
static const toBeDecided = 'toBeDecided';
static const registrationCarPlates = 'registrationCarPlates';
static const homeDeliveryService = 'homeDeliveryService';
static const specialServicechargesInsuranceDeliveryLocation = 'specialServicechargesInsuranceDeliveryLocation';
static const estimated = 'estimated';
static const servicesReservingAd = 'servicesReservingAd';
static const completeReservation = 'completeReservation';
static const contact = 'contact';
static const setDateandTime = 'setDateandTime';
static const selectOffice = 'selectOffice';
static const availableSlots = 'availableSlots';
static const bookAndPay = 'bookAndPay';
static const reservationAmounts = 'reservationAmounts';
static const tax = 'tax';
static const adsFilter = 'adsFilter';
static const searchByCity = 'searchByCity';
static const selectCity = 'selectCity';
static const searchByBrandName = 'searchByBrandName';
static const selectVehicleBrand = 'selectVehicleBrand';
static const searchByVehicleYear = 'searchByVehicleYear';
static const selectYear = 'selectYear';
static const searchByAdOwner = 'searchByAdOwner';
static const selectOwner = 'selectOwner';
static const search = 'search';
static const clearFilters = 'clearFilters';
static const book = 'book';
static const markAsSold = 'markAsSold';
static const deactivateAd = 'deactivateAd';
static const doWantDeactivateAd = 'doWantDeactivateAd';
static const stoptheBuyers = 'stoptheBuyers';
static const cancelReservation = 'cancelReservation';
static const reasonForCancellation = 'reasonForCancellation';
static const doWantCancelReservation = 'doWantCancelReservation';
static const yourAdVisibletoBuy = 'yourAdVisibletoBuy';
static const completeDeal = 'completeDeal';
static const uploadBankReceipt = 'uploadBankReceipt';
static const notesForAdmin = 'notesForAdmin';
static const extendAd = 'extendAd';
static const updateAdDetails = 'updateAdDetails';
static const durationExtendingAd = 'durationExtendingAd';
static const waitingAdminsResponse = 'waitingAdminsResponse';
static const cancelledByOwner = 'cancelledByOwner';
static const cancelledByAdmin = 'cancelledByAdmin';
static const reservationTimeOver = 'reservationTimeOver';
static const paymentVerified = 'paymentVerified';
static const rejectedFormAdmin = 'rejectedFormAdmin';
static const waitingAdminPost = 'waitingAdminPost';
static const waitingAdminsApproval = 'waitingAdminsApproval';
static const sold = 'sold';
static const noAdsShow = 'noAdsShow';
static const damagePartList = 'damagePartList';
static const searchPart = 'searchPart';
static const addSpecialService = 'addSpecialService';
static const vehicleVar = 'vehicleVar';
static const detailsVar = 'detailsVar';
static const damageVar = 'damageVar';
static const partsVar = 'partsVar';
static const additional = 'additional';
static const review = 'review';
static const adVar = 'adVar';
static const updateAd = 'updateAd';
static const createAd = 'createAd';
static const next = 'next';
static const submitAd = 'submitAd';
static const selectAdType = 'selectAdType';
static const validUntilSubscriptionExpiration = 'validUntilSubscriptionExpiration';
static const adsRemaining = 'adsRemaining';
static const youLeftAdsGivenSubscription = 'youLeftAdsGivenSubscription';
static const updateSubscription = 'updateSubscription';
static const workInProgress = 'workInProgress';
static const visitCompleted = 'visitCompleted';
static const youWantCancelAppointment = 'youWantCancelAppointment';
static const appointmentCancelledCannotUndoAction = 'appointmentCancelledCannotUndoAction';
static const appointment = 'appointment';
static const rescheduleAppointment = 'rescheduleAppointment';
static const payforAppointment = 'payforAppointment';
static const appointmentsFilter = 'appointmentsFilter';
static const searchByProvider = 'searchByProvider';
static const selectProvider = 'selectProvider';
static const searchByBranch = 'searchByBranch';
static const searchByCategory = 'searchByCategory';
static const selectCategory = 'selectCategory';
static const searchByService = 'searchByService';
static const selectServices = 'selectServices';
static const modifyPackage = 'modifyPackage';
} }

@ -6,7 +6,9 @@ import 'package:huawei_fido/huawei_fido.dart';
import 'package:local_auth/local_auth.dart'; import 'package:local_auth/local_auth.dart';
import 'package:local_auth_android/local_auth_android.dart'; import 'package:local_auth_android/local_auth_android.dart';
import 'package:local_auth_darwin/types/auth_messages_ios.dart'; import 'package:local_auth_darwin/types/auth_messages_ios.dart';
import 'package:mc_common_app/generated/locale_keys.g.dart';
import 'package:mc_common_app/main.dart'; import 'package:mc_common_app/main.dart';
import 'package:easy_localization/easy_localization.dart';
abstract class CommonAuthServices { abstract class CommonAuthServices {
Future<bool> authenticate(); Future<bool> authenticate();
@ -33,17 +35,17 @@ class CommonAuthImp implements CommonAuthServices {
useErrorDialogs: true, useErrorDialogs: true,
), ),
authMessages: [ authMessages: [
const AndroidAuthMessages( AndroidAuthMessages(
cancelButton: 'Cancel', cancelButton: LocaleKeys.cancel.tr(),
biometricHint: 'Please use your fingerprint or face ID', biometricHint: LocaleKeys.useFingerPrintFaceID.tr(),
goToSettingsButton: 'Settings', goToSettingsButton: LocaleKeys.settings.tr(),
goToSettingsDescription: 'Please set up your Touch ID.', goToSettingsDescription: LocaleKeys.setupTouchID.tr(),
), ),
const IOSAuthMessages( IOSAuthMessages(
cancelButton: 'Cancel', cancelButton: LocaleKeys.cancel.tr(),
goToSettingsButton: 'Settings', goToSettingsButton: LocaleKeys.settings.tr(),
goToSettingsDescription: 'Please set up your Touch ID.', goToSettingsDescription: LocaleKeys.setupTouchID.tr(),
lockOut: 'Please reenable your Touch ID', lockOut: LocaleKeys.reenableTouchID.tr(),
), ),
], ],
); );

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -6,6 +6,7 @@ import 'package:flutter/cupertino.dart';
import 'package:mc_common_app/classes/app_state.dart'; import 'package:mc_common_app/classes/app_state.dart';
import 'package:mc_common_app/classes/consts.dart'; import 'package:mc_common_app/classes/consts.dart';
import 'package:mc_common_app/extensions/string_extensions.dart'; import 'package:mc_common_app/extensions/string_extensions.dart';
import 'package:mc_common_app/generated/locale_keys.g.dart';
import 'package:mc_common_app/main.dart'; import 'package:mc_common_app/main.dart';
import 'package:mc_common_app/models/chat_models/chat_message_model.dart'; import 'package:mc_common_app/models/chat_models/chat_message_model.dart';
import 'package:mc_common_app/models/general_models/generic_resp_model.dart'; import 'package:mc_common_app/models/general_models/generic_resp_model.dart';
@ -17,6 +18,7 @@ import 'package:mc_common_app/utils/utils.dart';
import 'package:mc_common_app/view_models/requests_view_model.dart'; import 'package:mc_common_app/view_models/requests_view_model.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:signalr_core/signalr_core.dart'; import 'package:signalr_core/signalr_core.dart';
import 'package:easy_localization/easy_localization.dart';
class ChatVM extends ChangeNotifier { class ChatVM extends ChangeNotifier {
final ChatRepo chatRepo; final ChatRepo chatRepo;
@ -48,22 +50,22 @@ class ChatVM extends ChangeNotifier {
OfferRequestCommentModel( OfferRequestCommentModel(
index: 0, index: 0,
isSelected: false, isSelected: false,
title: "I have changed my mind.", title: LocaleKeys.changedMind.tr(),
), ),
OfferRequestCommentModel( OfferRequestCommentModel(
index: 1, index: 1,
isSelected: false, isSelected: false,
title: "Very High Price.", title: LocaleKeys.veryHighPrice.tr(),
), ),
OfferRequestCommentModel( OfferRequestCommentModel(
index: 2, index: 2,
isSelected: false, isSelected: false,
title: "Already Sold", title: LocaleKeys.alreadySold.tr(),
), ),
OfferRequestCommentModel( OfferRequestCommentModel(
index: 3, index: 3,
isSelected: true, isSelected: true,
title: "Other", title: LocaleKeys.otherVar.tr(),
), ),
]; ];
@ -100,11 +102,15 @@ class ChatVM extends ChangeNotifier {
return isValidated; return isValidated;
} }
Future<void> onNewMessageReceived({required List<ChatMessageModel> messages, required BuildContext context, bool isMyOwnOffer = false}) async { Future<void> onNewMessageReceived(
{required List<ChatMessageModel> messages,
required BuildContext context,
bool isMyOwnOffer = false}) async {
// log("message I received in onNewMessageReceived ${messages.first.toString()}"); // log("message I received in onNewMessageReceived ${messages.first.toString()}");
if (AppState().currentAppType == AppType.customer) { if (AppState().currentAppType == AppType.customer) {
for (var msg in messages) { for (var msg in messages) {
int providerIndex = serviceProviderOffersList.indexWhere((element) => element.providerUserId == msg.senderUserID); int providerIndex = serviceProviderOffersList.indexWhere(
(element) => element.providerUserId == msg.senderUserID);
if (providerIndex != -1) { if (providerIndex != -1) {
serviceProviderOffersList[providerIndex].chatMessages!.add(msg); serviceProviderOffersList[providerIndex].chatMessages!.add(msg);
} }
@ -114,11 +120,13 @@ class ChatVM extends ChangeNotifier {
// Where we need to call this function for saving a message in chat we will use receiverUserID and in those cases where received ID is null , it means it is a signal R call // Where we need to call this function for saving a message in chat we will use receiverUserID and in those cases where received ID is null , it means it is a signal R call
int providerIndex = -1; int providerIndex = -1;
if (isMyOwnOffer) { if (isMyOwnOffer) {
providerIndex = context.read<RequestsVM>().myFilteredRequests.indexWhere( providerIndex =
context.read<RequestsVM>().myFilteredRequests.indexWhere(
(element) => element.customerUserID == msg.receiverUserID, (element) => element.customerUserID == msg.receiverUserID,
); );
} else { } else {
providerIndex = context.read<RequestsVM>().myFilteredRequests.indexWhere( providerIndex =
context.read<RequestsVM>().myFilteredRequests.indexWhere(
(element) => element.customerUserID == msg.senderUserID, (element) => element.customerUserID == msg.senderUserID,
); );
} }
@ -126,7 +134,9 @@ class ChatVM extends ChangeNotifier {
// log("here is it: ${msg.senderUserID}"); // log("here is it: ${msg.senderUserID}");
// log("here is it: ${context.read<RequestsVM>().myFilteredRequests.first.customerUserID.toString()}"); // log("here is it: ${context.read<RequestsVM>().myFilteredRequests.first.customerUserID.toString()}");
if (providerIndex != -1) { if (providerIndex != -1) {
context.read<RequestsVM>().addChatMessagesInRequestsModel(msg: msg, index: providerIndex); context
.read<RequestsVM>()
.addChatMessagesInRequestsModel(msg: msg, index: providerIndex);
} }
} }
} }
@ -135,15 +145,18 @@ class ChatVM extends ChangeNotifier {
} }
Future<void> buildHubConnection(BuildContext context) async { Future<void> buildHubConnection(BuildContext context) async {
if (hubConnection == null || hubConnection!.state != HubConnectionState.connected) { if (hubConnection == null ||
hubConnection!.state != HubConnectionState.connected) {
try { try {
hubConnection = await chatRepo.getHubConnection(); hubConnection = await chatRepo.getHubConnection();
await hubConnection!.start(); await hubConnection!.start();
hubConnection!.on("ReceiveMessageRequestOffer", (List<Object?>? arguments) { hubConnection!.on("ReceiveMessageRequestOffer",
(List<Object?>? arguments) {
if (arguments == null || arguments.isEmpty) return; if (arguments == null || arguments.isEmpty) return;
List<ChatMessageModel> chat = []; List<ChatMessageModel> chat = [];
for (var message in arguments) { for (var message in arguments) {
final chatMessage = ChatMessageModel.fromJson(message as Map<String, dynamic>); final chatMessage =
ChatMessageModel.fromJson(message as Map<String, dynamic>);
chat.add(chatMessage); chat.add(chatMessage);
} }
onNewMessageReceived(messages: chat, context: context); onNewMessageReceived(messages: chat, context: context);
@ -165,7 +178,8 @@ class ChatVM extends ChangeNotifier {
required String offerPrice, required String offerPrice,
required BuildContext context, required BuildContext context,
}) async { }) async {
if (hubConnection == null || hubConnection!.state != HubConnectionState.connected) { if (hubConnection == null ||
hubConnection!.state != HubConnectionState.connected) {
await buildHubConnection(context); await buildHubConnection(context);
} }
if (hubConnection!.state == HubConnectionState.connected) { if (hubConnection!.state == HubConnectionState.connected) {
@ -183,7 +197,8 @@ class ChatVM extends ChangeNotifier {
"RequestID": requestId, "RequestID": requestId,
"Price": double.parse(offerPrice), "Price": double.parse(offerPrice),
"ServiceProviderID": providerId, "ServiceProviderID": providerId,
"OfferStatus": RequestOfferStatusEnum.offer.getIdFromRequestOfferStatusEnum(), "OfferStatus": RequestOfferStatusEnum.offer
.getIdFromRequestOfferStatusEnum(),
"Comment": message, "Comment": message,
}, },
} }
@ -207,7 +222,8 @@ class ChatVM extends ChangeNotifier {
}) async { }) async {
if (message.isEmpty) return false; if (message.isEmpty) return false;
if (hubConnection == null || hubConnection!.state != HubConnectionState.connected) { if (hubConnection == null ||
hubConnection!.state != HubConnectionState.connected) {
await buildHubConnection(context); await buildHubConnection(context);
} }
if (hubConnection!.state == HubConnectionState.connected) { if (hubConnection!.state == HubConnectionState.connected) {
@ -251,14 +267,21 @@ class ChatVM extends ChangeNotifier {
); );
if (AppState().currentAppType == AppType.customer) { if (AppState().currentAppType == AppType.customer) {
int providerIndex = serviceProviderOffersList.indexWhere((element) => element.providerUserId == receiverId); int providerIndex = serviceProviderOffersList
.indexWhere((element) => element.providerUserId == receiverId);
if (providerIndex != -1) { if (providerIndex != -1) {
serviceProviderOffersList[providerIndex].chatMessages!.add(chatMessageModel); serviceProviderOffersList[providerIndex]
.chatMessages!
.add(chatMessageModel);
} }
} else { } else {
int providerIndex = context.read<RequestsVM>().myFilteredRequests.indexWhere((element) => element.customerUserID == receiverId); int providerIndex = context
.read<RequestsVM>()
.myFilteredRequests
.indexWhere((element) => element.customerUserID == receiverId);
if (providerIndex != -1) { if (providerIndex != -1) {
context.read<RequestsVM>().addChatMessagesInRequestsModel(msg: chatMessageModel, index: providerIndex); context.read<RequestsVM>().addChatMessagesInRequestsModel(
msg: chatMessageModel, index: providerIndex);
} }
} }
return true; return true;
@ -268,10 +291,12 @@ class ChatVM extends ChangeNotifier {
List<ServiceProvidersOffers> serviceProviderOffersList = []; List<ServiceProvidersOffers> serviceProviderOffersList = [];
Future<void> getOffersFromProvidersByRequest({required int requestId, required BuildContext context}) async { Future<void> getOffersFromProvidersByRequest(
{required int requestId, required BuildContext context}) async {
try { try {
Utils.showLoading(context); Utils.showLoading(context);
ProviderOffersModel providerOffersModel = await requestRepo.getOffersFromProvidersByRequest(requestId: requestId); ProviderOffersModel providerOffersModel = await requestRepo
.getOffersFromProvidersByRequest(requestId: requestId);
Utils.hideLoading(context); Utils.hideLoading(context);
serviceProviderOffersList.clear(); serviceProviderOffersList.clear();
serviceProviderOffersList = providerOffersModel.serviceProviders ?? []; serviceProviderOffersList = providerOffersModel.serviceProviders ?? [];
@ -293,10 +318,15 @@ class ChatVM extends ChangeNotifier {
try { try {
int customerId = AppState().getUser.data!.userInfo!.customerId!; int customerId = AppState().getUser.data!.userInfo!.customerId!;
Utils.showLoading(context); Utils.showLoading(context);
List<ChatMessageModel> chatMessages = await chatRepo.getUsersChatMessages(providerId: providerId, customerId: customerId, requestOfferId: requestOfferId, requestId: requestId); List<ChatMessageModel> chatMessages = await chatRepo.getUsersChatMessages(
providerId: providerId,
customerId: customerId,
requestOfferId: requestOfferId,
requestId: requestId);
serviceProviderOffersList[providerOfferIndex].chatMessages = chatMessages; serviceProviderOffersList[providerOfferIndex].chatMessages = chatMessages;
if (serviceProviderOffersList[providerOfferIndex].chatMessages != null) { if (serviceProviderOffersList[providerOfferIndex].chatMessages != null) {
for (var message in serviceProviderOffersList[providerOfferIndex].chatMessages!) { for (var message
in serviceProviderOffersList[providerOfferIndex].chatMessages!) {
if (message.chatMessageTypeEnum == ChatMessageTypeEnum.offer) { if (message.chatMessageTypeEnum == ChatMessageTypeEnum.offer) {
updateLatestOfferId(message.reqOfferID ?? 0); updateLatestOfferId(message.reqOfferID ?? 0);
log("latestOfferId: $latestOfferId"); log("latestOfferId: $latestOfferId");
@ -322,8 +352,13 @@ class ChatVM extends ChangeNotifier {
try { try {
int providerId = AppState().getUser.data!.userInfo!.providerId!; int providerId = AppState().getUser.data!.userInfo!.providerId!;
Utils.showLoading(context); Utils.showLoading(context);
List<ChatMessageModel> chatMessages = await chatRepo.getUsersChatMessages(providerId: providerId, customerId: customerId, requestOfferId: requestOfferId, requestId: requestId); List<ChatMessageModel> chatMessages = await chatRepo.getUsersChatMessages(
context.read<RequestsVM>().overwriteChatMessagesInRequestsModel(messages: chatMessages, index: customerRequestIndex); providerId: providerId,
customerId: customerId,
requestOfferId: requestOfferId,
requestId: requestId);
context.read<RequestsVM>().overwriteChatMessagesInRequestsModel(
messages: chatMessages, index: customerRequestIndex);
Utils.hideLoading(context); Utils.hideLoading(context);
} catch (e) { } catch (e) {
logger.i(e.toString()); logger.i(e.toString());
@ -332,10 +367,16 @@ class ChatVM extends ChangeNotifier {
} }
} }
Future<int> onActionOfferTapped({required BuildContext context, required RequestOfferStatusEnum requestOfferStatusEnum, required int reqOfferId}) async { Future<int> onActionOfferTapped(
{required BuildContext context,
required RequestOfferStatusEnum requestOfferStatusEnum,
required int reqOfferId}) async {
try { try {
Utils.showLoading(context); Utils.showLoading(context);
GenericRespModel genericRespModel = await requestRepo.updateOfferRequestStatus(requestOfferStatusEnum: requestOfferStatusEnum, requestOfferId: reqOfferId); GenericRespModel genericRespModel =
await requestRepo.updateOfferRequestStatus(
requestOfferStatusEnum: requestOfferStatusEnum,
requestOfferId: reqOfferId);
Utils.hideLoading(context); Utils.hideLoading(context);
return genericRespModel.messageStatus == 1 ? reqOfferId : -1; return genericRespModel.messageStatus == 1 ? reqOfferId : -1;
} catch (e) { } catch (e) {

@ -3,6 +3,7 @@ import 'dart:developer';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:mc_common_app/config/routes.dart'; import 'package:mc_common_app/config/routes.dart';
import 'package:mc_common_app/extensions/string_extensions.dart'; import 'package:mc_common_app/extensions/string_extensions.dart';
import 'package:mc_common_app/generated/locale_keys.g.dart';
import 'package:mc_common_app/models/payment_models/pay_order_detail_resp_model.dart'; import 'package:mc_common_app/models/payment_models/pay_order_detail_resp_model.dart';
import 'package:mc_common_app/repositories/payments_repo.dart'; import 'package:mc_common_app/repositories/payments_repo.dart';
import 'package:mc_common_app/services/payments_service.dart'; import 'package:mc_common_app/services/payments_service.dart';
@ -11,7 +12,7 @@ import 'package:mc_common_app/utils/navigator.dart';
import 'package:mc_common_app/utils/utils.dart'; import 'package:mc_common_app/utils/utils.dart';
import 'package:mc_common_app/view_models/subscriptions_view_model.dart'; import 'package:mc_common_app/view_models/subscriptions_view_model.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:easy_localization/easy_localization.dart';
import '../classes/app_state.dart'; import '../classes/app_state.dart';
class PaymentVM extends ChangeNotifier { class PaymentVM extends ChangeNotifier {
@ -52,9 +53,8 @@ class PaymentVM extends ChangeNotifier {
notifyListeners(); notifyListeners();
} }
Future<void> onContinuePressed(BuildContext context, {required PaymentTypes paymentType}) async { Future<void> onContinuePressed(BuildContext context,
{required PaymentTypes paymentType}) async {
switch (selectedPaymentMethod) { switch (selectedPaymentMethod) {
case PaymentMethods.mada: case PaymentMethods.mada:
// TODO: Handle this case. // TODO: Handle this case.
@ -76,41 +76,53 @@ class PaymentVM extends ChangeNotifier {
return; return;
} }
Future<void> onAdsPaymentSuccess({required BuildContext context, required int currentAdId, required int paymentTypeId}) async { Future<void> onAdsPaymentSuccess(
{required BuildContext context,
required int currentAdId,
required int paymentTypeId}) async {
Utils.showLoading(context); Utils.showLoading(context);
PayOrderDetailRespModel payOrderDetailRespModel = await paymentRepo.getPayOrderDetails(paymentId: paymentTypeId, adId: currentAdId); PayOrderDetailRespModel payOrderDetailRespModel = await paymentRepo
.getPayOrderDetails(paymentId: paymentTypeId, adId: currentAdId);
await Future.delayed(const Duration(seconds: 2)); await Future.delayed(const Duration(seconds: 2));
Utils.hideLoading(context); Utils.hideLoading(context);
log("payOrderDetailRespModel: ${payOrderDetailRespModel.toString()}"); log("payOrderDetailRespModel: ${payOrderDetailRespModel.toString()}");
if (payOrderDetailRespModel.isPaid == null || !payOrderDetailRespModel.isPaid!) { if (payOrderDetailRespModel.isPaid == null ||
Utils.showToast("Payment Failed!"); !payOrderDetailRespModel.isPaid!) {
Utils.showToast(LocaleKeys.paymentFailed.tr());
return; return;
} }
if (payOrderDetailRespModel.isPaid != null && payOrderDetailRespModel.isPaid!) { if (payOrderDetailRespModel.isPaid != null &&
Utils.showToast("Payment Successful"); payOrderDetailRespModel.isPaid!) {
Utils.showToast(LocaleKeys.paymentSuccessful.tr());
navigateReplaceWithNameUntilRoute(context, AppRoutes.dashboard); navigateReplaceWithNameUntilRoute(context, AppRoutes.dashboard);
} }
} }
Future<void> onAppointmentPaymentSuccess({required BuildContext context, required int currentAdId, required int paymentTypeId}) async { Future<void> onAppointmentPaymentSuccess(
{required BuildContext context,
required int currentAdId,
required int paymentTypeId}) async {
Utils.showLoading(context); Utils.showLoading(context);
//TODO: CONFIRM FROM ZAHOOR THAT WILL THIS METHOD WORK FOR APPOINTMENT //TODO: CONFIRM FROM ZAHOOR THAT WILL THIS METHOD WORK FOR APPOINTMENT
PayOrderDetailRespModel payOrderDetailRespModel = await paymentRepo.getPayOrderDetails(paymentId: paymentTypeId, adId: currentAdId); PayOrderDetailRespModel payOrderDetailRespModel = await paymentRepo
.getPayOrderDetails(paymentId: paymentTypeId, adId: currentAdId);
await Future.delayed(const Duration(seconds: 2)); await Future.delayed(const Duration(seconds: 2));
Utils.hideLoading(context); Utils.hideLoading(context);
log("payOrderDetailRespModel: ${payOrderDetailRespModel.toString()}"); log("payOrderDetailRespModel: ${payOrderDetailRespModel.toString()}");
if (payOrderDetailRespModel.isPaid == null || !payOrderDetailRespModel.isPaid!) { if (payOrderDetailRespModel.isPaid == null ||
Utils.showToast("Payment Failed!"); !payOrderDetailRespModel.isPaid!) {
Utils.showToast(LocaleKeys.paymentFailed.tr());
return; return;
} }
if (payOrderDetailRespModel.isPaid != null && payOrderDetailRespModel.isPaid!) { if (payOrderDetailRespModel.isPaid != null &&
Utils.showToast("Payment Successful"); payOrderDetailRespModel.isPaid!) {
Utils.showToast(LocaleKeys.paymentSuccessful.tr());
navigateReplaceWithNameUntilRoute(context, AppRoutes.dashboard); navigateReplaceWithNameUntilRoute(context, AppRoutes.dashboard);
} }
} }
@ -131,14 +143,16 @@ class PaymentVM extends ChangeNotifier {
} }
} }
Future<void> placeThePayment({required PaymentTypes paymentTypeEnum, required BuildContext context}) async { Future<void> placeThePayment(
{required PaymentTypes paymentTypeEnum,
required BuildContext context}) async {
await paymentService.placePayment( await paymentService.placePayment(
// This will be request ID for request payment || ad ID for Ad Related Payment || OrderProviderSubscriptionID for SubscriptionPayment // This will be request ID for request payment || ad ID for Ad Related Payment || OrderProviderSubscriptionID for SubscriptionPayment
id: getIdTypeByPaymentType(paymentTypeEnum), id: getIdTypeByPaymentType(paymentTypeEnum),
appointmentIds: appointmentIdsForPayment, appointmentIds: appointmentIdsForPayment,
paymentType: paymentTypeEnum, paymentType: paymentTypeEnum,
onFailure: () { onFailure: () {
Utils.showToast("Payment Failed!"); Utils.showToast(LocaleKeys.paymentFailed.tr());
switch (paymentTypeEnum) { switch (paymentTypeEnum) {
case PaymentTypes.subscription: case PaymentTypes.subscription:
// TODO: Handle this case. // TODO: Handle this case.
@ -179,7 +193,10 @@ class PaymentVM extends ChangeNotifier {
case PaymentTypes.adReserve: case PaymentTypes.adReserve:
case PaymentTypes.ads: case PaymentTypes.ads:
case PaymentTypes.extendAds: case PaymentTypes.extendAds:
await onAdsPaymentSuccess(context: context, paymentTypeId: paymentTypeEnum.getIdFromPaymentTypesEnum(), currentAdId: currentAdId); await onAdsPaymentSuccess(
context: context,
paymentTypeId: paymentTypeEnum.getIdFromPaymentTypesEnum(),
currentAdId: currentAdId);
break; break;
case PaymentTypes.partialAppointment: case PaymentTypes.partialAppointment:
log("Partial Appointment Payment has been Succeeded"); log("Partial Appointment Payment has been Succeeded");
@ -189,21 +206,16 @@ class PaymentVM extends ChangeNotifier {
); );
} }
onSubscriptionSuccess(BuildContext context){ onSubscriptionSuccess(BuildContext context) {
pop(context); pop(context);
pop(context); pop(context);
pop(context); pop(context);
context.read<SubscriptionsVM>().getMySubscriptions( context.read<SubscriptionsVM>().getMySubscriptions(
AppState() AppState().getUser.data?.userInfo?.providerId.toString() ?? "");
.getUser
.data
?.userInfo
?.providerId
.toString() ??
"");
} }
Future<void> onVisaCardSelected(BuildContext context, PaymentTypes paymentType) async { Future<void> onVisaCardSelected(
BuildContext context, PaymentTypes paymentType) async {
currentPaymentType = paymentType; currentPaymentType = paymentType;
switch (currentPaymentType) { switch (currentPaymentType) {
case PaymentTypes.appointment: case PaymentTypes.appointment:

@ -8,6 +8,7 @@ import 'package:mc_common_app/classes/app_state.dart';
import 'package:mc_common_app/classes/consts.dart'; import 'package:mc_common_app/classes/consts.dart';
import 'package:mc_common_app/config/routes.dart'; import 'package:mc_common_app/config/routes.dart';
import 'package:mc_common_app/extensions/string_extensions.dart'; import 'package:mc_common_app/extensions/string_extensions.dart';
import 'package:mc_common_app/generated/locale_keys.g.dart';
import 'package:mc_common_app/models/advertisment_models/vehicle_details_models.dart'; import 'package:mc_common_app/models/advertisment_models/vehicle_details_models.dart';
import 'package:mc_common_app/models/chat_models/chat_message_model.dart'; import 'package:mc_common_app/models/chat_models/chat_message_model.dart';
import 'package:mc_common_app/models/general_models/enums_model.dart'; import 'package:mc_common_app/models/general_models/enums_model.dart';
@ -25,13 +26,17 @@ import 'package:mc_common_app/view_models/ad_view_model.dart';
import 'package:mc_common_app/view_models/base_view_model.dart'; import 'package:mc_common_app/view_models/base_view_model.dart';
import 'package:mc_common_app/view_models/chat_view_model.dart'; import 'package:mc_common_app/view_models/chat_view_model.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:easy_localization/easy_localization.dart';
class RequestsVM extends BaseVM { class RequestsVM extends BaseVM {
final CommonAppServices commonServices; final CommonAppServices commonServices;
final CommonRepo commonRepo; final CommonRepo commonRepo;
final RequestRepo requestRepo; final RequestRepo requestRepo;
RequestsVM({required this.commonServices, required this.commonRepo, required this.requestRepo}); RequestsVM(
{required this.commonServices,
required this.commonRepo,
required this.requestRepo});
List<RequestModel> myRequests = []; List<RequestModel> myRequests = [];
List<RequestModel> myFilteredRequests = []; List<RequestModel> myFilteredRequests = [];
@ -44,10 +49,14 @@ class RequestsVM extends BaseVM {
if (requestsTypeFilterOptions.isNotEmpty) return; if (requestsTypeFilterOptions.isNotEmpty) return;
if (myRequestsTypeEnum.isEmpty) { if (myRequestsTypeEnum.isEmpty) {
myRequestsTypeEnum = await commonRepo.getEnumTypeValues(enumTypeID: 16); //TODO: 16 is to get Requests Filter Enums myRequestsTypeEnum = await commonRepo.getEnumTypeValues(
enumTypeID: 16); //TODO: 16 is to get Requests Filter Enums
} }
for (int i = 0; i < myRequestsTypeEnum.length; i++) { for (int i = 0; i < myRequestsTypeEnum.length; i++) {
requestsTypeFilterOptions.add(FilterListModel(title: myRequestsTypeEnum[i].enumValueStr, isSelected: false, id: myRequestsTypeEnum[i].enumValue)); requestsTypeFilterOptions.add(FilterListModel(
title: myRequestsTypeEnum[i].enumValueStr,
isSelected: false,
id: myRequestsTypeEnum[i].enumValue));
} }
log("requestsTypeFilterOptions: ${requestsTypeFilterOptions.toString()}"); log("requestsTypeFilterOptions: ${requestsTypeFilterOptions.toString()}");
@ -55,7 +64,8 @@ class RequestsVM extends BaseVM {
notifyListeners(); notifyListeners();
} }
Future<void> getRequests({bool isNeedToRebuild = false, required AppType appType}) async { Future<void> getRequests(
{bool isNeedToRebuild = false, required AppType appType}) async {
if (isNeedToRebuild) setState(ViewState.busy); if (isNeedToRebuild) setState(ViewState.busy);
var paramsForGetRequests = <String, dynamic>{}; var paramsForGetRequests = <String, dynamic>{};
@ -66,22 +76,29 @@ class RequestsVM extends BaseVM {
"requestType": 0, "requestType": 0,
}; };
if (appType == AppType.provider) { if (appType == AppType.provider) {
paramsForGetRequests.addEntries([MapEntry("providerID", AppState().getUser.data!.userInfo!.providerId)]); paramsForGetRequests.addEntries([
MapEntry("providerID", AppState().getUser.data!.userInfo!.providerId)
]);
} else { } else {
paramsForGetRequests.addEntries([MapEntry("customerID", AppState().getUser.data!.userInfo!.customerId)]); paramsForGetRequests.addEntries([
MapEntry("customerID", AppState().getUser.data!.userInfo!.customerId)
]);
} }
myRequests = await requestRepo.getRequests(paramsForGetRequests); myRequests = await requestRepo.getRequests(paramsForGetRequests);
applyFilterOnRequestsVM(requestsTypeEnum: RequestsTypeEnum.specialCarRequest); applyFilterOnRequestsVM(
requestsTypeEnum: RequestsTypeEnum.specialCarRequest);
setState(ViewState.idle); setState(ViewState.idle);
notifyListeners(); notifyListeners();
} }
addChatMessagesInRequestsModel({required ChatMessageModel msg, required int index}) { addChatMessagesInRequestsModel(
{required ChatMessageModel msg, required int index}) {
myFilteredRequests[index].chatMessages.add(msg); myFilteredRequests[index].chatMessages.add(msg);
notifyListeners(); notifyListeners();
} }
overwriteChatMessagesInRequestsModel({required List<ChatMessageModel> messages, required int index}) { overwriteChatMessagesInRequestsModel(
{required List<ChatMessageModel> messages, required int index}) {
myFilteredRequests[index].chatMessages.clear(); myFilteredRequests[index].chatMessages.clear();
myFilteredRequests[index].chatMessages = messages; myFilteredRequests[index].chatMessages = messages;
notifyListeners(); notifyListeners();
@ -92,8 +109,14 @@ class RequestsVM extends BaseVM {
for (var value in requestsTypeFilterOptions) { for (var value in requestsTypeFilterOptions) {
value.isSelected = false; value.isSelected = false;
} }
requestsTypeFilterOptions[requestsTypeEnum.getIdFromRequestTypeStatusEnum() - 1].isSelected = true; // -1 to match with the index requestsTypeFilterOptions[
myFilteredRequests = myRequests.where((element) => element.requestType == requestsTypeEnum.getIdFromRequestTypeStatusEnum()).toList(); requestsTypeEnum.getIdFromRequestTypeStatusEnum() - 1]
.isSelected = true; // -1 to match with the index
myFilteredRequests = myRequests
.where((element) =>
element.requestType ==
requestsTypeEnum.getIdFromRequestTypeStatusEnum())
.toList();
notifyListeners(); notifyListeners();
} }
@ -102,7 +125,8 @@ class RequestsVM extends BaseVM {
String vehicleImageError = ""; String vehicleImageError = "";
void removeImageFromList(String filePath) { void removeImageFromList(String filePath) {
int index = pickedVehicleImages.indexWhere((element) => element.filePath == filePath); int index = pickedVehicleImages
.indexWhere((element) => element.filePath == filePath);
if (index == -1) { if (index == -1) {
return; return;
} }
@ -132,7 +156,8 @@ class RequestsVM extends BaseVM {
List<VehicleCountryModel> vehicleCountries = []; List<VehicleCountryModel> vehicleCountries = [];
List<VehicleCityModel> vehicleCities = []; List<VehicleCityModel> vehicleCities = [];
SelectionModel requestTypeId = SelectionModel(selectedOption: "", selectedId: -1, errorValue: ""); SelectionModel requestTypeId =
SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
void updateSelectionRequestTypeId(SelectionModel id) async { void updateSelectionRequestTypeId(SelectionModel id) async {
requestTypeId = id; requestTypeId = id;
@ -140,7 +165,8 @@ class RequestsVM extends BaseVM {
notifyListeners(); notifyListeners();
} }
SelectionModel vehicleTypeId = SelectionModel(selectedOption: "", selectedId: -1, errorValue: ""); SelectionModel vehicleTypeId =
SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
Future<void> getVehicleTypes() async { Future<void> getVehicleTypes() async {
resetRequestCreationForm(); resetRequestCreationForm();
@ -171,7 +197,8 @@ class RequestsVM extends BaseVM {
// } // }
isFetchingVehicleDetail = true; isFetchingVehicleDetail = true;
notifyListeners(); notifyListeners();
vehicleDetails = await commonRepo.getVehicleDetails(vehicleTypeId: vehicleTypeId.selectedId); vehicleDetails = await commonRepo.getVehicleDetails(
vehicleTypeId: vehicleTypeId.selectedId);
if (vehicleDetails != null) { if (vehicleDetails != null) {
vehicleBrands = vehicleDetails!.vehicleBrands!; vehicleBrands = vehicleDetails!.vehicleBrands!;
@ -183,24 +210,30 @@ class RequestsVM extends BaseVM {
notifyListeners(); notifyListeners();
} }
SelectionModel vehicleBrandId = SelectionModel(selectedOption: "", selectedId: -1, errorValue: ""); SelectionModel vehicleBrandId =
SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
void updateSelectionVehicleBrandId(SelectionModel id) { void updateSelectionVehicleBrandId(SelectionModel id) {
vehicleBrandId = id; vehicleBrandId = id;
vehicleModelId = SelectionModel(selectedOption: "", selectedId: -1, errorValue: ""); vehicleModelId =
vehicleModelYearId = SelectionModel(selectedOption: "", selectedId: -1, errorValue: ""); SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
vehicleModelYearId =
SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
notifyListeners(); notifyListeners();
} }
SelectionModel vehicleModelId = SelectionModel(selectedOption: "", selectedId: -1, errorValue: ""); SelectionModel vehicleModelId =
SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
void updateSelectionVehicleModelId(SelectionModel id) { void updateSelectionVehicleModelId(SelectionModel id) {
vehicleModelId = id; vehicleModelId = id;
vehicleModelYearId = SelectionModel(selectedOption: "", selectedId: -1, errorValue: ""); vehicleModelYearId =
SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
notifyListeners(); notifyListeners();
} }
SelectionModel vehicleModelYearId = SelectionModel(selectedOption: "", selectedId: -1, errorValue: ""); SelectionModel vehicleModelYearId =
SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
void updateSelectionVehicleModelYearId(SelectionModel id) { void updateSelectionVehicleModelYearId(SelectionModel id) {
vehicleModelYearId = id; vehicleModelYearId = id;
@ -215,18 +248,21 @@ class RequestsVM extends BaseVM {
} }
bool isCountryFetching = false; bool isCountryFetching = false;
SelectionModel vehicleCountryId = SelectionModel(selectedOption: "", selectedId: -1, errorValue: ""); SelectionModel vehicleCountryId =
SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
void updateSelectionVehicleCountryId(SelectionModel id) async { void updateSelectionVehicleCountryId(SelectionModel id) async {
vehicleCountryId = id; vehicleCountryId = id;
isCountryFetching = true; isCountryFetching = true;
notifyListeners(); notifyListeners();
vehicleCities = await commonRepo.getVehicleCities(countryId: vehicleCountryId.selectedId); vehicleCities = await commonRepo.getVehicleCities(
countryId: vehicleCountryId.selectedId);
isCountryFetching = false; isCountryFetching = false;
notifyListeners(); notifyListeners();
} }
SelectionModel vehicleCityId = SelectionModel(selectedOption: "", selectedId: -1, errorValue: ""); SelectionModel vehicleCityId =
SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
void updateSelectionVehicleCityId(SelectionModel id) { void updateSelectionVehicleCityId(SelectionModel id) {
vehicleCityId = id; vehicleCityId = id;
@ -244,10 +280,12 @@ class RequestsVM extends BaseVM {
description = v; description = v;
} }
Future<RequestPostingImages> convertFileToRequestPostingImages({required File file}) async { Future<RequestPostingImages> convertFileToRequestPostingImages(
{required File file}) async {
List<int> imageBytes = await file.readAsBytes(); List<int> imageBytes = await file.readAsBytes();
String image = base64Encode(imageBytes); String image = base64Encode(imageBytes);
RequestPostingImages vehiclePostingImages = RequestPostingImages(requestImage: image); RequestPostingImages vehiclePostingImages =
RequestPostingImages(requestImage: image);
return vehiclePostingImages; return vehiclePostingImages;
} }
@ -256,7 +294,8 @@ class RequestsVM extends BaseVM {
log("requestImages: ${pickedVehicleImages.length}"); log("requestImages: ${pickedVehicleImages.length}");
for (var image in pickedVehicleImages) { for (var image in pickedVehicleImages) {
var value = await convertFileToRequestPostingImages(file: File(image.filePath!)); var value =
await convertFileToRequestPostingImages(file: File(image.filePath!));
requestImages.add(value); requestImages.add(value);
} }
@ -267,7 +306,8 @@ class RequestsVM extends BaseVM {
if (validateCreateRequestForm()) { if (validateCreateRequestForm()) {
Utils.showLoading(context); Utils.showLoading(context);
List<RequestPostingImages> vehicleImages = await getVehiclePostingImageList(); List<RequestPostingImages> vehicleImages =
await getVehiclePostingImageList();
List requestImages = []; List requestImages = [];
vehicleImages.forEach((element) { vehicleImages.forEach((element) {
requestImages.add(element.toJson()); requestImages.add(element.toJson());
@ -291,7 +331,7 @@ class RequestsVM extends BaseVM {
GenericRespModel respModel = await requestRepo.createRequest(body); GenericRespModel respModel = await requestRepo.createRequest(body);
Utils.hideLoading(context); Utils.hideLoading(context);
if (respModel.messageStatus == 1) { if (respModel.messageStatus == 1) {
Utils.showToast("Request Successfully Created"); Utils.showToast(LocaleKeys.requestSuccessfullyCreated.tr());
Navigator.pop(context); Navigator.pop(context);
await getRequests(appType: AppType.customer); await getRequests(appType: AppType.customer);
} else { } else {
@ -307,40 +347,42 @@ class RequestsVM extends BaseVM {
bool validateCreateRequestForm() { bool validateCreateRequestForm() {
bool isValid = true; bool isValid = true;
if (requestTypeId.selectedId == -1) { if (requestTypeId.selectedId == -1) {
Utils.showToast("Please select valid Request Type"); Utils.showToast(LocaleKeys.selectValidRequestType.tr());
isValid = false; isValid = false;
} else if (vehicleTypeId.selectedId == -1) { } else if (vehicleTypeId.selectedId == -1) {
Utils.showToast("Please select valid Vehicle Type"); Utils.showToast(LocaleKeys.vehicle_selectValidVehicleType.tr());
isValid = false; isValid = false;
} else if (vehicleBrandId.selectedId == -1) { } else if (vehicleBrandId.selectedId == -1) {
Utils.showToast("Please select valid Brand"); Utils.showToast(LocaleKeys.selectValidBrand.tr());
isValid = false; isValid = false;
} else if (vehicleModelId.selectedId == -1) { } else if (vehicleModelId.selectedId == -1) {
Utils.showToast("Please select valid Model"); Utils.showToast(LocaleKeys.selectValidModel.tr());
isValid = false; isValid = false;
} else if (vehicleModelYearId.selectedId == -1) { } else if (vehicleModelYearId.selectedId == -1) {
Utils.showToast("Please select valid Year"); Utils.showToast(LocaleKeys.selectValidYear.tr());
isValid = false; isValid = false;
} else if (vehicleCountryId.selectedId == -1) { } else if (vehicleCountryId.selectedId == -1) {
Utils.showToast("Please select valid Country"); Utils.showToast(LocaleKeys.selectValidCountry.tr());
isValid = false; isValid = false;
} else if (vehicleCityId.selectedId == -1) { } else if (vehicleCityId.selectedId == -1) {
Utils.showToast("Please select valid City"); Utils.showToast(LocaleKeys.selectValidCity.tr());
isValid = false; isValid = false;
} else if (price.isEmpty) { } else if (price.isEmpty) {
Utils.showToast("Please add valid Price"); Utils.showToast(LocaleKeys.addValidPrice.tr());
isValid = false; isValid = false;
} else if (description.isEmpty) { } else if (description.isEmpty) {
Utils.showToast("Please add valid Description"); Utils.showToast(LocaleKeys.addValidDescription.tr());
isValid = false; isValid = false;
} }
return isValid; return isValid;
} }
Future<List<OffersModel>> getOffersByRequest({required int requestId, required BuildContext context}) async { Future<List<OffersModel>> getOffersByRequest(
{required int requestId, required BuildContext context}) async {
try { try {
Utils.showLoading(context); Utils.showLoading(context);
List<OffersModel> respModel = await requestRepo.getOffersByRequest(requestId: requestId); List<OffersModel> respModel =
await requestRepo.getOffersByRequest(requestId: requestId);
Utils.hideLoading(context); Utils.hideLoading(context);
return respModel; return respModel;
} catch (e) { } catch (e) {
@ -431,22 +473,26 @@ class RequestsVM extends BaseVM {
ChatMessageModel chatMessageModel = ChatMessageModel( ChatMessageModel chatMessageModel = ChatMessageModel(
isMyMessage: true, isMyMessage: true,
chatText: message, chatText: message,
messageType: ChatMessageTypeEnum.offer.getIdFromChatMessageTypeEnum(), messageType:
ChatMessageTypeEnum.offer.getIdFromChatMessageTypeEnum(),
senderName: senderName, senderName: senderName,
senderUserID: senderId, senderUserID: senderId,
receiverUserID: receiverId, receiverUserID: receiverId,
chatMessageTypeEnum: ChatMessageTypeEnum.offer, chatMessageTypeEnum: ChatMessageTypeEnum.offer,
requestID: requestModel.id, requestID: requestModel.id,
offerStatus: RequestOfferStatusEnum.offer.getIdFromRequestOfferStatusEnum(), offerStatus:
RequestOfferStatusEnum.offer.getIdFromRequestOfferStatusEnum(),
reqOffer: ReqOffer( reqOffer: ReqOffer(
offerStatus: RequestOfferStatusEnum.offer.getIdFromRequestOfferStatusEnum(), offerStatus: RequestOfferStatusEnum.offer
.getIdFromRequestOfferStatusEnum(),
requestID: requestModel.id, requestID: requestModel.id,
price: double.parse(offerPrice), price: double.parse(offerPrice),
requestOfferStatusEnum: RequestOfferStatusEnum.offer, requestOfferStatusEnum: RequestOfferStatusEnum.offer,
comment: message, comment: message,
offerStatusText: "", offerStatusText: "",
)); ));
context.read<ChatVM>().onNewMessageReceived(messages: [chatMessageModel], context: context, isMyOwnOffer: true); context.read<ChatVM>().onNewMessageReceived(
messages: [chatMessageModel], context: context, isMyOwnOffer: true);
if (!isFromChatScreen) { if (!isFromChatScreen) {
ChatViewArguments chatViewArguments = ChatViewArguments( ChatViewArguments chatViewArguments = ChatViewArguments(
chatTypeEnum: ChatTypeEnum.requestOffer, chatTypeEnum: ChatTypeEnum.requestOffer,
@ -456,7 +502,8 @@ class RequestsVM extends BaseVM {
requestIndex: requestIndex, requestIndex: requestIndex,
providerIndex: -1, providerIndex: -1,
); );
navigateWithName(context, AppRoutes.chatView, arguments: chatViewArguments); navigateWithName(context, AppRoutes.chatView,
arguments: chatViewArguments);
} }
} }
} }

@ -236,6 +236,7 @@
// } // }
import 'dart:io'; import 'dart:io';
import 'package:mc_common_app/generated/locale_keys.g.dart';
import 'package:mc_common_app/repositories/branch_repo.dart'; import 'package:mc_common_app/repositories/branch_repo.dart';
import 'package:file_picker/file_picker.dart'; import 'package:file_picker/file_picker.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -257,6 +258,7 @@ import 'package:mc_common_app/utils/enums.dart';
import 'package:mc_common_app/utils/utils.dart'; import 'package:mc_common_app/utils/utils.dart';
import 'package:mc_common_app/view_models/base_view_model.dart'; import 'package:mc_common_app/view_models/base_view_model.dart';
import 'package:mc_common_app/widgets/dropdown/dropdow_field.dart'; import 'package:mc_common_app/widgets/dropdown/dropdow_field.dart';
import 'package:easy_localization/easy_localization.dart';
class ServiceVM extends BaseVM { class ServiceVM extends BaseVM {
final BranchRepo branchRepo; final BranchRepo branchRepo;
@ -324,7 +326,7 @@ class ServiceVM extends BaseVM {
int sizeInBytes = file.lengthSync(); int sizeInBytes = file.lengthSync();
// double sizeInMb = sizeInBytes / (1024 * 1024); // double sizeInMb = sizeInBytes / (1024 * 1024);
if (sizeInBytes > 1000000) { if (sizeInBytes > 1000000) {
Utils.showToast("File is larger then 1KB"); Utils.showToast(LocaleKeys.fileLarger.tr());
} else { } else {
document!.data![index].document = Utils.convertFileToBase64(file); document!.data![index].document = Utils.convertFileToBase64(file);
document!.data![index].fileExt = Utils.checkFileExt(file.path); document!.data![index].fileExt = Utils.checkFileExt(file.path);
@ -348,7 +350,8 @@ class ServiceVM extends BaseVM {
setState(ViewState.idle); setState(ViewState.idle);
} }
Future<void> getAllCountriesList(BranchDetailModel? branchData, String countryCode) async { Future<void> getAllCountriesList(
BranchDetailModel? branchData, String countryCode) async {
cities = null; cities = null;
country = null; country = null;
setState(ViewState.busy); setState(ViewState.busy);
@ -360,7 +363,9 @@ class ServiceVM extends BaseVM {
countryId = element.id ?? -1; countryId = element.id ?? -1;
countryValue = DropValue( countryValue = DropValue(
element.id ?? 0, element.id ?? 0,
countryCode == "SA" ? (element.countryNameN ?? "") : (element.countryName ?? ""), countryCode == "SA"
? (element.countryNameN ?? "")
: (element.countryName ?? ""),
element.countryCode ?? "", element.countryCode ?? "",
); );
} }
@ -368,7 +373,9 @@ class ServiceVM extends BaseVM {
countryDropList.add( countryDropList.add(
DropValue( DropValue(
element.id ?? 0, element.id ?? 0,
countryCode == "SA" ? (element.countryNameN ?? "") : (element.countryName ?? ""), countryCode == "SA"
? (element.countryNameN ?? "")
: (element.countryName ?? ""),
element.countryCode ?? "", element.countryCode ?? "",
), ),
); );
@ -379,7 +386,8 @@ class ServiceVM extends BaseVM {
setState(ViewState.idle); setState(ViewState.idle);
} }
Future<void> getAllCities(BranchDetailModel? branchData, String countryCode) async { Future<void> getAllCities(
BranchDetailModel? branchData, String countryCode) async {
setState(ViewState.busy); setState(ViewState.busy);
citiesDropList = []; citiesDropList = [];
cities = null; cities = null;
@ -398,7 +406,9 @@ class ServiceVM extends BaseVM {
cityId = branchData.cityId!; cityId = branchData.cityId!;
cityValue = DropValue( cityValue = DropValue(
element.id ?? 0, element.id ?? 0,
countryCode == "SA" ? (element.cityNameN ?? "") : (element.cityName ?? ""), countryCode == "SA"
? (element.cityNameN ?? "")
: (element.cityName ?? ""),
element.id.toString() ?? "", element.id.toString() ?? "",
); );
} }
@ -406,7 +416,9 @@ class ServiceVM extends BaseVM {
citiesDropList.add( citiesDropList.add(
DropValue( DropValue(
element.id ?? 0, element.id ?? 0,
countryCode == "SA" ? (element.cityNameN ?? "") : (element.cityName ?? ""), countryCode == "SA"
? (element.cityNameN ?? "")
: (element.cityName ?? ""),
element.id.toString() ?? "", element.id.toString() ?? "",
), ),
); );
@ -414,8 +426,10 @@ class ServiceVM extends BaseVM {
setState(ViewState.idle); setState(ViewState.idle);
} }
Future<MResponse> createBranch(String branchName, String branchDescription, String cityId, String address, String latitude, String longitude) async { Future<MResponse> createBranch(String branchName, String branchDescription,
return await branchRepo.createBranch(branchName, branchDescription, cityId.toString(), address, latitude.toString(), longitude.toString()); String cityId, String address, String latitude, String longitude) async {
return await branchRepo.createBranch(branchName, branchDescription,
cityId.toString(), address, latitude.toString(), longitude.toString());
} }
Future<MResponse> updateBranch( Future<MResponse> updateBranch(
@ -489,7 +503,8 @@ class ServiceVM extends BaseVM {
Future<void> fetchServicesByCategoryId(int categoryId) async { Future<void> fetchServicesByCategoryId(int categoryId) async {
servicesDropList = []; servicesDropList = [];
setState(ViewState.busy); setState(ViewState.busy);
services = await branchRepo.fetchServicesByCategoryId(serviceCategoryId: categoryId); // to get all the services services = await branchRepo.fetchServicesByCategoryId(
serviceCategoryId: categoryId); // to get all the services
for (var element in services!.data!) { for (var element in services!.data!) {
servicesDropList.add( servicesDropList.add(
DropValue( DropValue(
@ -536,13 +551,16 @@ class ServiceVM extends BaseVM {
List<ServiceModel>? matchedServices; List<ServiceModel>? matchedServices;
bool isAllSelected = false; bool isAllSelected = false;
Future<void> getAllMatchedServices(int oldBranchId, int newBranchId, int categoryId) async { Future<void> getAllMatchedServices(
int oldBranchId, int newBranchId, int categoryId) async {
matchedServices = null; matchedServices = null;
final MResponse response = await branchRepo.getMatchedServices(oldBranchId, newBranchId, categoryId); final MResponse response = await branchRepo.getMatchedServices(
oldBranchId, newBranchId, categoryId);
matchedServices = []; matchedServices = [];
if (response.messageStatus == 1) { if (response.messageStatus == 1) {
matchedServices = List<ServiceModel>.from(response.data.map((x) => ServiceModel.fromJson(x))); matchedServices = List<ServiceModel>.from(
response.data.map((x) => ServiceModel.fromJson(x)));
} }
notifyListeners(); notifyListeners();
} }
@ -583,7 +601,8 @@ class ServiceVM extends BaseVM {
MResponse response = await branchRepo.getAllProviderDealers(map); MResponse response = await branchRepo.getAllProviderDealers(map);
if (response.messageStatus == 1) { if (response.messageStatus == 1) {
allProviderDealersList = []; allProviderDealersList = [];
allProviderDealersList = List<BranchUser>.from(response.data.map((x) => BranchUser.fromJson(x))); allProviderDealersList = List<BranchUser>.from(
response.data.map((x) => BranchUser.fromJson(x)));
} }
setState(ViewState.idle); setState(ViewState.idle);
} }
@ -593,7 +612,8 @@ class ServiceVM extends BaseVM {
MResponse response = await branchRepo.getBranchUsers(map); MResponse response = await branchRepo.getBranchUsers(map);
if (response.messageStatus == 1) { if (response.messageStatus == 1) {
branchUserList = []; branchUserList = [];
branchUserList = List<BranchUser>.from(response.data.map((x) => BranchUser.fromJson(x))); branchUserList = List<BranchUser>.from(
response.data.map((x) => BranchUser.fromJson(x)));
} }
setState(ViewState.idle); setState(ViewState.idle);
} }

@ -1,6 +1,5 @@
import 'dart:convert'; import 'dart:convert';
import 'package:mc_common_app/classes/app_state.dart'; import 'package:mc_common_app/classes/app_state.dart';
import 'package:mc_common_app/models/general_models/m_response.dart'; import 'package:mc_common_app/models/general_models/m_response.dart';
import 'package:mc_common_app/models/subscriptions_models/branch_user_selection_model.dart'; import 'package:mc_common_app/models/subscriptions_models/branch_user_selection_model.dart';
@ -8,7 +7,6 @@ import 'package:mc_common_app/models/subscriptions_models/subscription_model.dar
import 'package:mc_common_app/utils/enums.dart'; import 'package:mc_common_app/utils/enums.dart';
import 'package:mc_common_app/view_models/base_view_model.dart'; import 'package:mc_common_app/view_models/base_view_model.dart';
import 'package:mc_common_app/widgets/dropdown/dropdow_field.dart'; import 'package:mc_common_app/widgets/dropdown/dropdow_field.dart';
import '../repositories/subscription_repo.dart'; import '../repositories/subscription_repo.dart';
class SubscriptionsVM extends BaseVM { class SubscriptionsVM extends BaseVM {
@ -171,7 +169,8 @@ class SubscriptionsVM extends BaseVM {
selectedIndex = 0; selectedIndex = 0;
setState(ViewState.busy); setState(ViewState.busy);
// allSubscriptions = await subscriptionRepo.getAllSubscriptions(serviceProviderID); // allSubscriptions = await subscriptionRepo.getAllSubscriptions(serviceProviderID);
allSubscriptions = await subscriptionRepo.getMySubscriptions(serviceProviderID); allSubscriptions =
await subscriptionRepo.getMySubscriptions(serviceProviderID);
if (allSubscriptions.messageStatus == 1) { if (allSubscriptions.messageStatus == 1) {
// allSubscriptions.data!.sort((a, b) => a.value.compareTo(b.value)); // allSubscriptions.data!.sort((a, b) => a.value.compareTo(b.value));
setState(ViewState.idle); setState(ViewState.idle);

@ -10,9 +10,11 @@ import 'package:http/http.dart';
import 'package:huawei_fido/huawei_fido.dart'; import 'package:huawei_fido/huawei_fido.dart';
import 'package:image_picker/image_picker.dart'; import 'package:image_picker/image_picker.dart';
import 'package:local_auth/local_auth.dart'; import 'package:local_auth/local_auth.dart';
import 'package:logger/logger.dart';
import 'package:mc_common_app/classes/app_state.dart'; import 'package:mc_common_app/classes/app_state.dart';
import 'package:mc_common_app/classes/consts.dart'; import 'package:mc_common_app/classes/consts.dart';
import 'package:mc_common_app/config/routes.dart'; import 'package:mc_common_app/config/routes.dart';
import 'package:mc_common_app/extensions/string_extensions.dart';
import 'package:mc_common_app/generated/locale_keys.g.dart'; import 'package:mc_common_app/generated/locale_keys.g.dart';
import 'package:mc_common_app/main.dart'; import 'package:mc_common_app/main.dart';
import 'package:mc_common_app/models/general_models/m_response.dart'; import 'package:mc_common_app/models/general_models/m_response.dart';
@ -226,17 +228,17 @@ class UserVM extends BaseVM {
void checkPassword(String password) { void checkPassword(String password) {
if (password.length <= 6) { if (password.length <= 6) {
updateStrengthThreshold(1 / 4); updateStrengthThreshold(1 / 4);
updateStrengthText('Your password is too short'); updateStrengthText(LocaleKeys.passwordTooShort.tr());
} else if (password.length < 8) { } else if (password.length < 8) {
updateStrengthThreshold(2 / 4); updateStrengthThreshold(2 / 4);
updateStrengthText('Your password is acceptable but not strong'); updateStrengthText(LocaleKeys.passwordAcceptableStrong.tr());
} else { } else {
if (!letterReg.hasMatch(password) || !numReg.hasMatch(password)) { if (!letterReg.hasMatch(password) || !numReg.hasMatch(password)) {
updateStrengthThreshold(3 / 4); updateStrengthThreshold(3 / 4);
updateStrengthText('Your password is strong'); updateStrengthText(LocaleKeys.passwordIsStrong.tr());
} else { } else {
updateStrengthThreshold(1); updateStrengthThreshold(1);
updateStrengthText('Your password is very strong'); updateStrengthText(LocaleKeys.passwordVeryStrong.tr());
} }
} }
notifyListeners(); notifyListeners();
@ -360,7 +362,7 @@ class UserVM extends BaseVM {
SharedPrefManager.setData(jsonEncode(user.data!.userInfo!.toJson())); SharedPrefManager.setData(jsonEncode(user.data!.userInfo!.toJson()));
navigateReplaceWithName(context, AppRoutes.dashboard); navigateReplaceWithName(context, AppRoutes.dashboard);
} else { } else {
Utils.showToast("LocaleKeys.onlyProviderApp.tr()"); Utils.showToast(LocaleKeys.onlyProviderApp.tr());
//("Sorry, Only Customer's can log in this app"); //("Sorry, Only Customer's can log in this app");
} }
} else if (user.data!.userInfo!.roleId == 4) { } else if (user.data!.userInfo!.roleId == 4) {
@ -372,7 +374,7 @@ class UserVM extends BaseVM {
SharedPrefManager.setData(jsonEncode(user.data!.userInfo!.toJson())); SharedPrefManager.setData(jsonEncode(user.data!.userInfo!.toJson()));
navigateReplaceWithName(context, AppRoutes.dashboard); navigateReplaceWithName(context, AppRoutes.dashboard);
} else { } else {
Utils.showToast("Sorry, Only Customer's can log in this app"); Utils.showToast(LocaleKeys.onlyCustomerApp.tr());
} }
} }
} else { } else {
@ -402,7 +404,7 @@ class UserVM extends BaseVM {
SharedPrefManager.setData(jsonEncode(user.data!.userInfo!.toJson())); SharedPrefManager.setData(jsonEncode(user.data!.userInfo!.toJson()));
navigateReplaceWithName(context, AppRoutes.dashboard); navigateReplaceWithName(context, AppRoutes.dashboard);
} else { } else {
Utils.showToast("LocaleKeys.onlyProviderApp.tr()"); Utils.showToast(LocaleKeys.onlyProviderApp.tr());
//("Sorry, Only Customer's can log in this app"); //("Sorry, Only Customer's can log in this app");
} }
} else if (user.data!.userInfo!.roleId == 4) { } else if (user.data!.userInfo!.roleId == 4) {
@ -414,7 +416,7 @@ class UserVM extends BaseVM {
SharedPrefManager.setData(jsonEncode(user.data!.userInfo!.toJson())); SharedPrefManager.setData(jsonEncode(user.data!.userInfo!.toJson()));
navigateReplaceWithName(context, AppRoutes.dashboard); navigateReplaceWithName(context, AppRoutes.dashboard);
} else { } else {
Utils.showToast("Sorry, Only Customer's can log in this app"); Utils.showToast(LocaleKeys.onlyCustomerApp.tr());
} }
} }
} else { } else {
@ -507,13 +509,23 @@ class UserVM extends BaseVM {
} }
} }
Future<void> performBasicOtpLoginWithPasswordPage(BuildContext context, {required ClassType type, required String countryCode, required String phoneNum, required String password}) async { Future<void> performBasicOtpLoginWithPasswordPage(BuildContext context, {required ClassType type, String? countryCode, required String phoneNum, required String password}) async {
Utils.showLoading(context); Utils.showLoading(context);
Response response = await userRepo.loginV1(type == ClassType.NUMBER ? countryCode + phoneNum : phoneNum, password); Response response = await userRepo.loginV1(
type == ClassType.NUMBER && countryCode != null
? countryCode + phoneNum
: type == ClassType.NUMBER && countryCode == null
? phoneNum
: phoneNum,
password);
Utils.hideLoading(context); Utils.hideLoading(context);
LoginPasswordRespModel user = LoginPasswordRespModel.fromJson(jsonDecode(response.body)); LoginPasswordRespModel user = LoginPasswordRespModel.fromJson(jsonDecode(response.body));
if (user.messageStatus == 1) { if (user.messageStatus == 1) {
SharedPrefManager.setPhoneOrEmail(type == ClassType.NUMBER ? countryCode + phoneNum : phoneNum); SharedPrefManager.setPhoneOrEmail(type == ClassType.NUMBER && countryCode != null
? countryCode + phoneNum
: type == ClassType.NUMBER && countryCode == null
? phoneNum
: phoneNum);
SharedPrefManager.setUserPassword(password); SharedPrefManager.setUserPassword(password);
navigateReplaceWithName(context, AppRoutes.loginMethodSelection, arguments: user.data!.userToken); navigateReplaceWithName(context, AppRoutes.loginMethodSelection, arguments: user.data!.userToken);
} else { } else {
@ -604,4 +616,20 @@ class UserVM extends BaseVM {
print(imageBytes); print(imageBytes);
return base64Encode(imageBytes); return base64Encode(imageBytes);
} }
Future<void> isAlreadyUserLoggedin(BuildContext context) async {
String uName = await SharedPrefManager.getPhoneOrEmail();
String pass = await SharedPrefManager.getUserPassword();
if (uName.isNotEmpty && pass.isNotEmpty) {
logger.d(uName);
if (uName.isNum()) {
performBasicOtpLoginWithPasswordPage(context, type: ClassType.NUMBER, countryCode: null, phoneNum: uName, password: pass);
}
if (uName.isValidEmail()) {
performBasicOtpLoginWithPasswordPage(context, type: ClassType.EMAIL, countryCode: null, phoneNum: uName, password: pass);
}
logger.d("Skip Login Triggered");
}
}
} }

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:mc_common_app/config/routes.dart'; import 'package:mc_common_app/config/routes.dart';
import 'package:mc_common_app/extensions/int_extensions.dart'; import 'package:mc_common_app/extensions/int_extensions.dart';
import 'package:mc_common_app/extensions/string_extensions.dart'; import 'package:mc_common_app/extensions/string_extensions.dart';
import 'package:mc_common_app/generated/locale_keys.g.dart';
import 'package:mc_common_app/main.dart'; import 'package:mc_common_app/main.dart';
import 'package:mc_common_app/models/advertisment_models/ads_duration_model.dart'; import 'package:mc_common_app/models/advertisment_models/ads_duration_model.dart';
import 'package:mc_common_app/models/general_models/widgets_models.dart'; import 'package:mc_common_app/models/general_models/widgets_models.dart';
@ -12,12 +13,16 @@ import 'package:mc_common_app/view_models/ad_view_model.dart';
import 'package:mc_common_app/widgets/button/show_fill_button.dart'; import 'package:mc_common_app/widgets/button/show_fill_button.dart';
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:easy_localization/easy_localization.dart';
class AdDurationSelectionSheetContent extends StatelessWidget { class AdDurationSelectionSheetContent extends StatelessWidget {
final bool isFromExtendAd; final bool isFromExtendAd;
final bool isUpdateAdSelected; final bool isUpdateAdSelected;
const AdDurationSelectionSheetContent({super.key, required this.isFromExtendAd, required this.isUpdateAdSelected}); const AdDurationSelectionSheetContent(
{super.key,
required this.isFromExtendAd,
required this.isUpdateAdSelected});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -28,7 +33,10 @@ class AdDurationSelectionSheetContent extends StatelessWidget {
children: [ children: [
Row( Row(
children: [ children: [
"Select Duration".toText(fontSize: 22, isBold: true).paddingOnly(top: 10, left: 21, right: 21), LocaleKeys.selectDuration
.tr()
.toText(fontSize: 22, isBold: true)
.paddingOnly(top: 10, left: 21, right: 21),
], ],
), ),
Expanded( Expanded(
@ -48,22 +56,32 @@ class AdDurationSelectionSheetContent extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
"${adDuration.days} Days".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( "Your Ad will be active for ${adDuration.days} Days and then you will need to extend it to keep it active. "
.toText(
fontSize: 14, fontSize: 14,
color: MyColors.lightTextColor, color: MyColors.lightTextColor,
), ),
12.height, 12.height,
"Ad Charges".toText(fontSize: 14, color: MyColors.lightTextColor, isBold: true), LocaleKeys.adCharges.tr().toText(
fontSize: 14,
color: MyColors.lightTextColor,
isBold: true),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
"${adDuration.price}".toText(fontSize: 22, isBold: true), "${adDuration.price}"
.toText(fontSize: 22, isBold: true),
2.width, 2.width,
Padding( Padding(
padding: const EdgeInsets.only(bottom: 4), padding: const EdgeInsets.only(bottom: 4),
child: "SAR".toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true), child: LocaleKeys.sar.tr().toText(
fontSize: 12,
color: MyColors.lightTextColor,
isBold: true),
), ),
], ],
), ),
@ -74,14 +92,16 @@ class AdDurationSelectionSheetContent extends StatelessWidget {
).toWhiteContainer( ).toWhiteContainer(
width: double.infinity, width: double.infinity,
allPading: 12, allPading: 12,
isBorderRequired: adDuration.id == adVM.vehicleAdDurationId.selectedId, isBorderRequired:
adDuration.id == adVM.vehicleAdDurationId.selectedId,
), ),
).onPress(() { ).onPress(() {
if (isFromExtendAd) { if (isFromExtendAd) {
adVM.updateVehicleExtendAdDurationId( adVM.updateVehicleExtendAdDurationId(
SelectionModel( SelectionModel(
selectedId: adDuration.id ?? 0, selectedId: adDuration.id ?? 0,
selectedOption: "${adDuration.days} Days", selectedOption:
("${adDuration.days} " + LocaleKeys.daysVar.tr()),
itemPrice: adDuration.price!.toInt().toString(), itemPrice: adDuration.price!.toInt().toString(),
), ),
); );
@ -90,7 +110,8 @@ class AdDurationSelectionSheetContent extends StatelessWidget {
adVM.updateVehicleAdDurationId( adVM.updateVehicleAdDurationId(
SelectionModel( SelectionModel(
selectedId: adDuration.id ?? 0, selectedId: adDuration.id ?? 0,
selectedOption: "${adDuration.days} Days", selectedOption:
("${adDuration.days} " + LocaleKeys.daysVar.tr()),
itemPrice: adDuration.price!.toInt().toString(), itemPrice: adDuration.price!.toInt().toString(),
), ),
); );
@ -103,15 +124,17 @@ class AdDurationSelectionSheetContent extends StatelessWidget {
), ),
), ),
ShowFillButton( ShowFillButton(
iconWidget: adVM.isFetchingLists ? const Padding( iconWidget: adVM.isFetchingLists
? const Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: SizedBox( child: SizedBox(
height: 30, height: 30,
width: 30, width: 30,
child: CircularProgressIndicator(color: Colors.white), child: CircularProgressIndicator(color: Colors.white),
), ),
) : null, )
title: adVM.isFetchingLists ? "" : "Select", : null,
title: adVM.isFetchingLists ? "" : LocaleKeys.select.tr(),
maxWidth: double.infinity, maxWidth: double.infinity,
margin: const EdgeInsets.all(21), margin: const EdgeInsets.all(21),
onPressed: () { onPressed: () {
@ -119,7 +142,8 @@ class AdDurationSelectionSheetContent extends StatelessWidget {
return; return;
} else { } else {
if (isFromExtendAd && !isUpdateAdSelected) { if (isFromExtendAd && !isUpdateAdSelected) {
navigateWithName(context, AppRoutes.paymentMethodsView, arguments: PaymentTypes.extendAds); navigateWithName(context, AppRoutes.paymentMethodsView,
arguments: PaymentTypes.extendAds);
return; return;
} }
navigateReplaceWithName(context, AppRoutes.createAdView); navigateReplaceWithName(context, AppRoutes.createAdView);
@ -131,7 +155,8 @@ class AdDurationSelectionSheetContent extends StatelessWidget {
); );
} }
Widget showItem(String item, String value, {Color valueColor = Colors.black}) { Widget showItem(String item, String value,
{Color valueColor = Colors.black}) {
return Row( return Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,

@ -1,12 +1,10 @@
import 'dart:async'; import 'dart:async';
import 'dart:convert';
import 'dart:developer';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:mc_common_app/classes/consts.dart'; import 'package:mc_common_app/classes/consts.dart';
import 'package:mc_common_app/config/routes.dart'; import 'package:mc_common_app/config/routes.dart';
import 'package:mc_common_app/extensions/int_extensions.dart'; import 'package:mc_common_app/extensions/int_extensions.dart';
import 'package:mc_common_app/extensions/string_extensions.dart'; import 'package:mc_common_app/extensions/string_extensions.dart';
import 'package:mc_common_app/generated/locale_keys.g.dart';
import 'package:mc_common_app/main.dart'; import 'package:mc_common_app/main.dart';
import 'package:mc_common_app/models/advertisment_models/ad_details_model.dart'; import 'package:mc_common_app/models/advertisment_models/ad_details_model.dart';
import 'package:mc_common_app/models/advertisment_models/ads_bank_details_model.dart'; import 'package:mc_common_app/models/advertisment_models/ads_bank_details_model.dart';
@ -32,6 +30,7 @@ import 'package:mc_common_app/widgets/dropdown/dropdow_field.dart';
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
import 'package:mc_common_app/widgets/txt_field.dart'; import 'package:mc_common_app/widgets/txt_field.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:easy_localization/easy_localization.dart';
class AdsDetailView extends StatefulWidget { class AdsDetailView extends StatefulWidget {
final AdDetailsModel adDetails; final AdDetailsModel adDetails;
@ -62,12 +61,12 @@ class _AdsDetailViewState extends State<AdsDetailView> {
AdVM adVM = context.read<AdVM>(); AdVM adVM = context.read<AdVM>();
return actionConfirmationBottomSheet( return actionConfirmationBottomSheet(
context: context, context: context,
title: "Do you want to delete the ad?".toText(fontSize: 28, isBold: true, letterSpacing: -1.44), title: LocaleKeys.deleteAdConfirmation.tr().toText(fontSize: 28, isBold: true, letterSpacing: -1.44),
subtitle: "Your ad will be permanently deleted and you cannot undo this action.", subtitle: LocaleKeys.deleteAdConfirmationMessage.tr(),
actionButtonYes: Expanded( actionButtonYes: Expanded(
child: ShowFillButton( child: ShowFillButton(
maxHeight: 55, maxHeight: 55,
title: "Yes", title: LocaleKeys.yes.tr(),
fontSize: 15, fontSize: 15,
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
@ -80,7 +79,7 @@ class _AdsDetailViewState extends State<AdsDetailView> {
maxHeight: 55, maxHeight: 55,
isFilled: false, isFilled: false,
borderColor: MyColors.darkPrimaryColor, borderColor: MyColors.darkPrimaryColor,
title: "No", title: LocaleKeys.no.tr(),
txtColor: MyColors.darkPrimaryColor, txtColor: MyColors.darkPrimaryColor,
fontSize: 15, fontSize: 15,
onPressed: () { onPressed: () {
@ -95,7 +94,7 @@ class _AdsDetailViewState extends State<AdsDetailView> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: CustomAppBar( appBar: CustomAppBar(
title: "Ads", title: LocaleKeys.ads.tr(),
profileImageUrl: MyAssets.bnCar, profileImageUrl: MyAssets.bnCar,
isRemoveBackButton: false, isRemoveBackButton: false,
isDrawerEnabled: false, isDrawerEnabled: false,
@ -155,7 +154,7 @@ class _AdsDetailViewState extends State<AdsDetailView> {
children: [ children: [
Row( Row(
children: [ children: [
"Model: ".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor), (LocaleKeys.model.tr() + ": ").toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
"${widget.adDetails.vehicle!.modelyear!.label}".toText( "${widget.adDetails.vehicle!.modelyear!.label}".toText(
fontSize: 14, fontSize: 14,
isBold: true, isBold: true,
@ -170,7 +169,7 @@ class _AdsDetailViewState extends State<AdsDetailView> {
children: [ children: [
Row( Row(
children: [ children: [
"Mileage: ".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor), (LocaleKeys.mileage.tr() + ": ").toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
"${widget.adDetails.vehicle!.mileage!.mileageEnd}Km".toText( "${widget.adDetails.vehicle!.mileage!.mileageEnd}Km".toText(
fontSize: 14, fontSize: 14,
isBold: true, isBold: true,
@ -184,7 +183,7 @@ class _AdsDetailViewState extends State<AdsDetailView> {
), ),
Row( Row(
children: [ children: [
"Transmission: ".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor), (LocaleKeys.transmission.tr() + ": ").toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
"${widget.adDetails.vehicle!.transmission!.label}".toText( "${widget.adDetails.vehicle!.transmission!.label}".toText(
fontSize: 14, fontSize: 14,
isBold: true, isBold: true,
@ -192,26 +191,26 @@ class _AdsDetailViewState extends State<AdsDetailView> {
], ],
), ),
8.height, 8.height,
"Description: ".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor), (LocaleKeys.description.tr() + ": ").toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
"${widget.adDetails.vehicle!.vehicleDescription}".toText( "${widget.adDetails.vehicle!.vehicleDescription}".toText(
fontSize: 14, fontSize: 14,
isBold: true, isBold: true,
), ),
if (widget.adDetails.isMyAd ?? false) ...[ if (widget.adDetails.isMyAd ?? false) ...[
8.height, 8.height,
"Demand: ".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor), (LocaleKeys.demand.tr() + ": ").toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
Row( Row(
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),
" SAR".toText(fontSize: 15, isBold: true, color: MyColors.lightTextColor).paddingOnly(bottom: 5), LocaleKeys.sar.tr().toText(fontSize: 15, isBold: true, color: MyColors.lightTextColor).paddingOnly(bottom: 5),
], ],
), ),
if (widget.adDetails.adPostStatus == AdPostStatus.expired) ...[ if (widget.adDetails.adPostStatus == AdPostStatus.expired) ...[
8.height, 8.height,
const Divider(thickness: 1, height: 1), const Divider(thickness: 1, height: 1),
8.height, 8.height,
"Your Ad Duration time is over.".toText( LocaleKeys.adDurationExpired.tr().toText(
color: MyColors.redColor, color: MyColors.redColor,
fontSize: 12, fontSize: 12,
isItalic: true, isItalic: true,
@ -227,7 +226,7 @@ class _AdsDetailViewState extends State<AdsDetailView> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
"Bank Details".toText(fontSize: 18, isBold: true), LocaleKeys.bankDetails.tr().toText(fontSize: 18, isBold: true),
// Row( // Row(
// children: [ // children: [
// "Full Name: ".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor), // "Full Name: ".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
@ -239,7 +238,7 @@ class _AdsDetailViewState extends State<AdsDetailView> {
// ), // ),
Row( Row(
children: [ children: [
"Bank Name: ".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor), (LocaleKeys.bankName.tr() + ": ").toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
(adVM.adsBankDetailsModel!.bankName ?? "").toText( (adVM.adsBankDetailsModel!.bankName ?? "").toText(
fontSize: 14, fontSize: 14,
isBold: true, isBold: true,
@ -248,7 +247,7 @@ class _AdsDetailViewState extends State<AdsDetailView> {
), ),
Row( Row(
children: [ children: [
"IBAN: ".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor), (LocaleKeys.iban.tr() + ": ").toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
(adVM.adsBankDetailsModel!.iban ?? "").toText( (adVM.adsBankDetailsModel!.iban ?? "").toText(
fontSize: 14, fontSize: 14,
isBold: true, isBold: true,
@ -270,10 +269,10 @@ class _AdsDetailViewState extends State<AdsDetailView> {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
"Rejection Comments".toText(fontSize: 13, isBold: true, color: MyColors.lightTextColor), LocaleKeys.rejectionComments.tr().toText(fontSize: 13, isBold: true, color: MyColors.lightTextColor),
Row( Row(
children: [ children: [
"Edit Ad".toText(fontSize: 10, isBold: true), LocaleKeys.editAd.tr().toText(fontSize: 10, isBold: true),
2.width, 2.width,
const Icon(Icons.edit, size: 15), const Icon(Icons.edit, size: 15),
], ],
@ -312,7 +311,7 @@ class _AdsDetailViewState extends State<AdsDetailView> {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
widget.adDetails.vehicle!.demandAmount!.toInt().toString().toText(fontSize: 30, isBold: true), widget.adDetails.vehicle!.demandAmount!.toInt().toString().toText(fontSize: 30, isBold: true),
" SAR".toText(fontSize: 15, isBold: true, color: MyColors.lightTextColor).paddingOnly(bottom: 5), LocaleKeys.sar.tr().toText(fontSize: 15, isBold: true, color: MyColors.lightTextColor).paddingOnly(bottom: 5),
], ],
), ),
14.height, 14.height,
@ -340,37 +339,37 @@ class BuildAdDetailsActionButtonForExploreAds extends StatelessWidget {
enableDrag: true, enableDrag: true,
builder: (BuildContext context) { builder: (BuildContext context) {
return InfoBottomSheet( return InfoBottomSheet(
title: "Reserve Ad".toText(fontSize: 24, isBold: true), title: LocaleKeys.reserveAd.tr().toText(fontSize: 24, isBold: true),
description: Column( description: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
"Reservation Amount".toText(fontSize: 16, isBold: true), LocaleKeys.reservationAmount.tr().toText(fontSize: 16, isBold: true),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
"${adDetailsModel.reservePrice}".toText(fontSize: 19, isBold: true), "${adDetailsModel.reservePrice}".toText(fontSize: 19, isBold: true),
2.width, 2.width,
"SAR".toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 3), LocaleKeys.sar.tr().toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 3),
], ],
) )
], ],
), ),
const Divider(), const Divider(),
"Below Amount that you will pay later".toText(fontSize: 12), LocaleKeys.belowAmountPayLater.tr().toText(fontSize: 12),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
"Car Price".toText(fontSize: 16, isBold: true), LocaleKeys.carPrice.tr().toText(fontSize: 16, isBold: true),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
"${adDetailsModel.vehicle!.demandAmount ?? 0.0}".toText(fontSize: 19, isBold: true), "${adDetailsModel.vehicle!.demandAmount ?? 0.0}".toText(fontSize: 19, isBold: true),
2.width, 2.width,
"SAR".toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 3), LocaleKeys.sar.tr().toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 3),
], ],
) )
], ],
@ -379,48 +378,48 @@ class BuildAdDetailsActionButtonForExploreAds extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
"VAT Excluded".toText(fontSize: 10, isBold: true), LocaleKeys.vatExcluded.tr().toText(fontSize: 10, isBold: true),
], ],
), ),
const Divider(), const Divider(),
"Special Services".toText(fontSize: 16, isBold: true), LocaleKeys.specialService.toText(fontSize: 16, isBold: true),
5.height, 5.height,
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
"Car insurance Service".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor, fontWeight: FontWeight.w500), LocaleKeys.carInsuranceService.tr().toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor, fontWeight: FontWeight.w500),
"To be Decided".toText(fontSize: 12, isBold: true), LocaleKeys.toBeDecided.tr().toText(fontSize: 12, isBold: true),
], ],
), ),
5.height, 5.height,
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
"Registration & Car Plates".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor), LocaleKeys.registrationCarPlates.tr().toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
"To be Decided".toText(fontSize: 12, isBold: true), LocaleKeys.toBeDecided.tr().toText(fontSize: 12, isBold: true),
], ],
), ),
5.height, 5.height,
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
"Home Delivery Service".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor), LocaleKeys.homeDeliveryService.tr().toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
"To be Decided".toText(fontSize: 12, isBold: true), LocaleKeys.toBeDecided.tr().toText(fontSize: 12, isBold: true),
], ],
), ),
12.height, 12.height,
"Special service charges will be added based on desired insurance and delivery Location".toText(fontSize: 12, maxLines: 2), LocaleKeys.specialServicechargesInsuranceDeliveryLocation.tr().toText(fontSize: 12, maxLines: 2),
30.height, 30.height,
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
"Total Amount ".toText(fontSize: 16, isBold: true), LocaleKeys.totalAmount.tr().toText(fontSize: 16, isBold: true),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
"${(adDetailsModel.vehicle!.demandAmount ?? 0.0)}".toText(fontSize: 19, isBold: true), "${(adDetailsModel.vehicle!.demandAmount ?? 0.0)}".toText(fontSize: 19, isBold: true),
2.width, 2.width,
"SAR".toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 3), LocaleKeys.sar.tr().toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 3),
], ],
) )
], ],
@ -429,7 +428,7 @@ class BuildAdDetailsActionButtonForExploreAds extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
"Estimated".toText(fontSize: 10, isBold: true), LocaleKeys.estimated.tr().toText(fontSize: 10, isBold: true),
], ],
), ),
30.height, 30.height,
@ -442,7 +441,7 @@ class BuildAdDetailsActionButtonForExploreAds extends StatelessWidget {
size: 19, size: 19,
).paddingOnly(bottom: 2), ).paddingOnly(bottom: 2),
3.width, 3.width,
"Some services are mandatory while reserving Ad.".toText( LocaleKeys.servicesReservingAd.tr().toText(
color: MyColors.adPendingStatusColor, color: MyColors.adPendingStatusColor,
fontSize: 12, fontSize: 12,
isItalic: true, isItalic: true,
@ -455,7 +454,7 @@ class BuildAdDetailsActionButtonForExploreAds extends StatelessWidget {
Expanded( Expanded(
child: ShowFillButton( child: ShowFillButton(
maxHeight: 55, maxHeight: 55,
title: "Complete Reservation", title: LocaleKeys.completeReservation.tr(),
onPressed: () async { onPressed: () async {
// Navigator.pop(context); // Navigator.pop(context);
bool status = await context.read<AdVM>().createReserveAd(adId: adDetailsModel.id!, context: context); bool status = await context.read<AdVM>().createReserveAd(adId: adDetailsModel.id!, context: context);
@ -479,7 +478,7 @@ class BuildAdDetailsActionButtonForExploreAds extends StatelessWidget {
Expanded( Expanded(
child: ShowFillButton( child: ShowFillButton(
maxHeight: 55, maxHeight: 55,
title: "Reserve Ad", title: LocaleKeys.reserveAd.tr(),
onPressed: () { onPressed: () {
reserveAdPriceBreakDownClicked(context, adDetailsModel); reserveAdPriceBreakDownClicked(context, adDetailsModel);
// navigateWithName(context, AppRoutes.paymentMethodsView); // navigateWithName(context, AppRoutes.paymentMethodsView);
@ -523,7 +522,7 @@ class BuildAdDetailsActionButtonForExploreAds extends StatelessWidget {
Expanded( Expanded(
child: ShowFillButton( child: ShowFillButton(
maxHeight: 55, maxHeight: 55,
title: "Contact", title: LocaleKeys.contact.tr(),
fontSize: 18, fontSize: 18,
isBold: false, isBold: false,
iconWidget: const Padding( iconWidget: const Padding(
@ -584,7 +583,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
builder: (BuildContext context) { builder: (BuildContext context) {
return Consumer(builder: (BuildContext context, AdVM adVM, Widget? child) { return Consumer(builder: (BuildContext context, AdVM adVM, Widget? child) {
return InfoBottomSheet( return InfoBottomSheet(
title: "Set Date and Time".toText(fontSize: 16, isBold: true, letterSpacing: -1.44, height: 1.2), title: LocaleKeys.setDateandTime.tr().toText(fontSize: 16, isBold: true, letterSpacing: -1.44, height: 1.2),
description: Column( description: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -604,7 +603,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
// here the item price is the index of the selected option // here the item price is the index of the selected option
list: vehicleCitiesDrop, list: vehicleCitiesDrop,
dropdownValue: adVM.photoOfficeSelectedId.selectedId != -1 ? DropValue(adVM.photoOfficeSelectedId.selectedId, adVM.photoOfficeSelectedId.selectedOption, "") : null, dropdownValue: adVM.photoOfficeSelectedId.selectedId != -1 ? DropValue(adVM.photoOfficeSelectedId.selectedId, adVM.photoOfficeSelectedId.selectedOption, "") : null,
hint: "Select Office", hint: LocaleKeys.selectOffice.tr(),
errorValue: adVM.photoOfficeSelectedId.errorValue, errorValue: adVM.photoOfficeSelectedId.errorValue,
); );
}, },
@ -621,7 +620,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
("Available Slots").toText(fontSize: 14, isBold: true), LocaleKeys.availableSlots.tr().toText(fontSize: 14, isBold: true),
], ],
), ),
5.height, 5.height,
@ -640,7 +639,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
Expanded( Expanded(
child: ShowFillButton( child: ShowFillButton(
maxHeight: 55, maxHeight: 55,
title: "Book and Pay", title: LocaleKeys.bookAndPay.tr(),
fontSize: 15, fontSize: 15,
onPressed: () { onPressed: () {
adVM.onAdSSBookAppointmentPressed(context, adDetailsModel: adDetailsModel, adsSpecialServiceID: 1); //1 for photography Service adVM.onAdSSBookAppointmentPressed(context, adDetailsModel: adDetailsModel, adsSpecialServiceID: 1); //1 for photography Service
@ -665,37 +664,37 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
enableDrag: true, enableDrag: true,
builder: (BuildContext context) { builder: (BuildContext context) {
return InfoBottomSheet( return InfoBottomSheet(
title: "Reserve Ad".toText(fontSize: 24, isBold: true), title: LocaleKeys.reserveAd.tr().toText(fontSize: 24, isBold: true),
description: Column( description: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
"Reservation Amounts".toText(fontSize: 16, isBold: true), LocaleKeys.reservationAmounts.tr().toText(fontSize: 16, isBold: true),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
"500".toText(fontSize: 19, isBold: true), "500".toText(fontSize: 19, isBold: true),
2.width, 2.width,
"SAR".toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 3), LocaleKeys.sar.tr().toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 3),
], ],
) )
], ],
), ),
const Divider(), const Divider(),
"Below Amount that you will pay later".toText(fontSize: 12), LocaleKeys.belowAmountPayLater.tr().toText(fontSize: 12),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
"Car Price".toText(fontSize: 16, isBold: true), LocaleKeys.carPrice.tr().toText(fontSize: 16, isBold: true),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
"30,000".toText(fontSize: 19, isBold: true), "30,000".toText(fontSize: 19, isBold: true),
2.width, 2.width,
"SAR".toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 3), LocaleKeys.sar.tr().toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 3),
], ],
) )
], ],
@ -703,56 +702,56 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
"Tax".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor), LocaleKeys.tax.tr().toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
"4,500".toText(fontSize: 16, isBold: true), "4,500".toText(fontSize: 16, isBold: true),
2.width, 2.width,
"SAR".toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 0), LocaleKeys.sar.tr().toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 0),
], ],
) )
], ],
), ),
const Divider(), const Divider(),
"Special Services".toText(fontSize: 16, isBold: true), LocaleKeys.specialService.tr().toText(fontSize: 16, isBold: true),
5.height, 5.height,
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
"Car insurance Service".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor, fontWeight: FontWeight.w500), LocaleKeys.carInsuranceService.tr().toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor, fontWeight: FontWeight.w500),
"To be Decided".toText(fontSize: 12, isBold: true), LocaleKeys.toBeDecided.tr().toText(fontSize: 12, isBold: true),
], ],
), ),
5.height, 5.height,
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
"Registration & Car Plates".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor), LocaleKeys.registrationCarPlates.tr().toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
"To be Decided".toText(fontSize: 12, isBold: true), LocaleKeys.toBeDecided.tr().toText(fontSize: 12, isBold: true),
], ],
), ),
5.height, 5.height,
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
"Home Delivery Service".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor), LocaleKeys.homeDeliveryService.tr().toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
"To be Decided".toText(fontSize: 12, isBold: true), LocaleKeys.toBeDecided.tr().toText(fontSize: 12, isBold: true),
], ],
), ),
12.height, 12.height,
"Special service charges will be added based on desired insurance and delivery Location".toText(fontSize: 12), LocaleKeys.specialServicechargesInsuranceDeliveryLocation.tr().toText(fontSize: 12),
30.height, 30.height,
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
"Total Amount ".toText(fontSize: 16, isBold: true), LocaleKeys.totalAmount.tr().toText(fontSize: 16, isBold: true),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
"34,500".toText(fontSize: 19, isBold: true), "34,500".toText(fontSize: 19, isBold: true),
2.width, 2.width,
"SAR".toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 3), LocaleKeys.sar.tr().toText(color: MyColors.lightTextColor, fontSize: 10, isBold: true).paddingOnly(bottom: 3),
], ],
) )
], ],
@ -761,7 +760,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
"Estimated".toText(fontSize: 10, isBold: true), LocaleKeys.estimated.tr().toText(fontSize: 10, isBold: true),
], ],
), ),
44.height, 44.height,
@ -774,7 +773,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
size: 19, size: 19,
).paddingOnly(bottom: 2), ).paddingOnly(bottom: 2),
3.width, 3.width,
"Some services are mandatory while reserving the Ad.".toText( LocaleKeys.servicesReservingAd.tr().toText(
color: MyColors.adPendingStatusColor, color: MyColors.adPendingStatusColor,
fontSize: 12, fontSize: 12,
isItalic: true, isItalic: true,
@ -787,7 +786,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
Expanded( Expanded(
child: ShowFillButton( child: ShowFillButton(
maxHeight: 55, maxHeight: 55,
title: "Complete Reservation", title: LocaleKeys.completeReservation.tr(),
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
navigateWithName(context, AppRoutes.paymentMethodsView); navigateWithName(context, AppRoutes.paymentMethodsView);
@ -843,7 +842,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
isFilled: false, isFilled: false,
borderColor: MyColors.darkPrimaryColor, borderColor: MyColors.darkPrimaryColor,
maxHeight: 55, maxHeight: 55,
title: "Book ${photoSpecialServiceModel.name}", title: (LocaleKeys.book.tr() + " ${photoSpecialServiceModel.name}"),
txtColor: MyColors.darkPrimaryColor, txtColor: MyColors.darkPrimaryColor,
onPressed: () { onPressed: () {
onBookPhotographyServiceClicked(context, adDetailsModel: adDetailsModel); onBookPhotographyServiceClicked(context, adDetailsModel: adDetailsModel);
@ -862,7 +861,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
backgroundColor: payButtonStatus ? MyColors.grey98Color.withOpacity(0.3) : MyColors.darkPrimaryColor, backgroundColor: payButtonStatus ? MyColors.grey98Color.withOpacity(0.3) : MyColors.darkPrimaryColor,
txtColor: payButtonStatus ? MyColors.lightTextColor : MyColors.white, txtColor: payButtonStatus ? MyColors.lightTextColor : MyColors.white,
isBold: false, isBold: false,
title: "Pay Now", title: LocaleKeys.payNow.tr(),
onPressed: () { onPressed: () {
if (photoSpecialServiceModel == null) { if (photoSpecialServiceModel == null) {
navigateWithName(context, AppRoutes.paymentMethodsView, arguments: PaymentTypes.ads); navigateWithName(context, AppRoutes.paymentMethodsView, arguments: PaymentTypes.ads);
@ -886,7 +885,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
Expanded( Expanded(
child: ShowFillButton( child: ShowFillButton(
maxHeight: 55, maxHeight: 55,
title: "Mark As Sold", title: LocaleKeys.markAsSold.tr(),
isBold: false, isBold: false,
onPressed: () { onPressed: () {
adVM.markAdAsSold(context, adId: adDetailsModel.id!); adVM.markAdAsSold(context, adId: adDetailsModel.id!);
@ -903,17 +902,17 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
isFilled: false, isFilled: false,
borderColor: MyColors.redColor, borderColor: MyColors.redColor,
maxHeight: 55, maxHeight: 55,
title: "Deactivate Ad", title: LocaleKeys.deactivateAd.tr(),
txtColor: MyColors.redColor, txtColor: MyColors.redColor,
onPressed: () { onPressed: () {
return actionConfirmationBottomSheet( return actionConfirmationBottomSheet(
context: context, context: context,
title: "Do you want to the Deactivate this Ad?".toText(fontSize: 28, isBold: true, letterSpacing: -1.44), title: LocaleKeys.doWantDeactivateAd.tr().toText(fontSize: 28, isBold: true, letterSpacing: -1.44),
subtitle: "We will stop showing this ad to the buyers.", subtitle: LocaleKeys.stoptheBuyers.tr(),
actionButtonYes: Expanded( actionButtonYes: Expanded(
child: ShowFillButton( child: ShowFillButton(
maxHeight: 55, maxHeight: 55,
title: "Yes", title: LocaleKeys.yes.tr(),
fontSize: 15, fontSize: 15,
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
@ -926,7 +925,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
maxHeight: 55, maxHeight: 55,
isFilled: false, isFilled: false,
borderColor: MyColors.darkPrimaryColor, borderColor: MyColors.darkPrimaryColor,
title: "No", title: LocaleKeys.no.tr(),
txtColor: MyColors.darkPrimaryColor, txtColor: MyColors.darkPrimaryColor,
fontSize: 15, fontSize: 15,
onPressed: () { onPressed: () {
@ -951,12 +950,9 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
enableDrag: true, enableDrag: true,
builder: (BuildContext context) { builder: (BuildContext context) {
return InfoBottomSheet( return InfoBottomSheet(
title: "Cancel Reservation".toText(fontSize: 28, isBold: true, letterSpacing: -1.44), title: LocaleKeys.cancelReservation.tr().toText(fontSize: 28, isBold: true, letterSpacing: -1.44),
description: Padding( description: Padding(
padding: EdgeInsets.only(bottom: MediaQuery padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
.of(context)
.viewInsets
.bottom),
child: Consumer<AdVM>( child: Consumer<AdVM>(
builder: (BuildContext context, AdVM adVM, Widget? child) { builder: (BuildContext context, AdVM adVM, Widget? child) {
return Column( return Column(
@ -971,26 +967,26 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
value: adVM.reservationCancelReason, value: adVM.reservationCancelReason,
errorValue: adVM.reservationCancelError, errorValue: adVM.reservationCancelError,
keyboardType: TextInputType.text, keyboardType: TextInputType.text,
hint: "Reason for cancellation", hint: LocaleKeys.reasonForCancellation.tr(),
onChanged: (v) => adVM.updateReservationCancelReason(v), onChanged: (v) => adVM.updateReservationCancelReason(v),
), ),
], ],
), ),
25.height, 25.height,
ShowFillButton( ShowFillButton(
title: "Submit", title: LocaleKeys.submit.tr(),
onPressed: () { onPressed: () {
bool status = adVM.validateReservationCancelReason(); bool status = adVM.validateReservationCancelReason();
if (status) { if (status) {
Navigator.pop(context); Navigator.pop(context);
return actionConfirmationBottomSheet( return actionConfirmationBottomSheet(
context: context, context: context,
title: "Do you want to cancel the reservation?".toText(fontSize: 28, isBold: true, letterSpacing: -1.44), title: LocaleKeys.doWantCancelReservation.tr().toText(fontSize: 28, isBold: true, letterSpacing: -1.44),
subtitle: "Your ad reservation will be cancelled and this ad will be again visible to everyone to buy.", subtitle: LocaleKeys.yourAdVisibletoBuy.tr(),
actionButtonYes: Expanded( actionButtonYes: Expanded(
child: ShowFillButton( child: ShowFillButton(
maxHeight: 55, maxHeight: 55,
title: "Yes", title: LocaleKeys.yes.tr(),
fontSize: 15, fontSize: 15,
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
@ -1003,7 +999,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
maxHeight: 55, maxHeight: 55,
isFilled: false, isFilled: false,
borderColor: MyColors.darkPrimaryColor, borderColor: MyColors.darkPrimaryColor,
title: "No", title: LocaleKeys.no.tr(),
txtColor: MyColors.darkPrimaryColor, txtColor: MyColors.darkPrimaryColor,
fontSize: 15, fontSize: 15,
onPressed: () { onPressed: () {
@ -1036,7 +1032,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
isFilled: false, isFilled: false,
fontSize: 16, fontSize: 16,
maxHeight: 55, maxHeight: 55,
title: "Cancel Reservation", title: LocaleKeys.cancelReservation.tr(),
onPressed: () { onPressed: () {
buildCancelReservationBottomSheet(context, adDetails: adDetails); buildCancelReservationBottomSheet(context, adDetails: adDetails);
}), }),
@ -1054,7 +1050,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
backgroundColor: MyColors.darkPrimaryColor, backgroundColor: MyColors.darkPrimaryColor,
txtColor: MyColors.white, txtColor: MyColors.white,
isBold: false, isBold: false,
title: "Complete Deal", title: LocaleKeys.completeDeal.tr(),
onPressed: () { onPressed: () {
buildCompleteDealBottomSheet(context, adDetails: adDetails); buildCompleteDealBottomSheet(context, adDetails: adDetails);
}), }),
@ -1070,12 +1066,9 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
enableDrag: true, enableDrag: true,
builder: (BuildContext context) { builder: (BuildContext context) {
return InfoBottomSheet( return InfoBottomSheet(
title: "Upload Bank Receipt".toText(fontSize: 26, isBold: true, letterSpacing: -1.44), title: LocaleKeys.uploadBankReceipt.tr().toText(fontSize: 26, isBold: true, letterSpacing: -1.44),
description: Padding( description: Padding(
padding: EdgeInsets.only(bottom: MediaQuery padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
.of(context)
.viewInsets
.bottom),
child: Consumer<AdVM>( child: Consumer<AdVM>(
builder: (BuildContext context, AdVM adVM, Widget? child) { builder: (BuildContext context, AdVM adVM, Widget? child) {
return Column( return Column(
@ -1090,13 +1083,13 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
value: adVM.completeDealNotesForAdmin, value: adVM.completeDealNotesForAdmin,
errorValue: "", errorValue: "",
keyboardType: TextInputType.text, keyboardType: TextInputType.text,
hint: "Notes For Admin", hint: LocaleKeys.notesForAdmin.tr(),
onChanged: (v) => adVM.updateCompleteDealNotesForAdmin(v), onChanged: (v) => adVM.updateCompleteDealNotesForAdmin(v),
), ),
], ],
), ),
15.height, 15.height,
"Attach File".toText(fontSize: 20, isBold: true, letterSpacing: -0.5), LocaleKeys.attachFile.tr().toText(fontSize: 20, isBold: true, letterSpacing: -0.5),
if (adVM.pickedReceiptPdfFiles.isNotEmpty) ...[ if (adVM.pickedReceiptPdfFiles.isNotEmpty) ...[
16.height, 16.height,
PickedFilesContainer( PickedFilesContainer(
@ -1107,8 +1100,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
}, },
isPdf: true, isPdf: true,
), ),
] else ] else ...[
...[
Row( Row(
children: [ children: [
Container( Container(
@ -1131,7 +1123,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
], ],
15.height, 15.height,
ShowFillButton( ShowFillButton(
title: "Submit", title: LocaleKeys.submit.tr(),
onPressed: () { onPressed: () {
//Upload Attachment //Upload Attachment
}, },
@ -1154,17 +1146,17 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
child: ShowFillButton( child: ShowFillButton(
fontSize: 16, fontSize: 16,
maxHeight: 55, maxHeight: 55,
title: "Extend Ad", title: LocaleKeys.extendAd.tr(),
onPressed: () { onPressed: () {
final AdVM adVM = context.read<AdVM>(); final AdVM adVM = context.read<AdVM>();
return actionConfirmationBottomSheet( return actionConfirmationBottomSheet(
context: context, context: context,
title: "Do you want to update the Ad Details?".toText(fontSize: 28, isBold: true, letterSpacing: -1.44), title: LocaleKeys.updateAdDetails.tr().toText(fontSize: 28, isBold: true, letterSpacing: -1.44),
subtitle: "You can change the ad duration and details before extending the ad.", subtitle: LocaleKeys.durationExtendingAd.tr(),
actionButtonYes: Expanded( actionButtonYes: Expanded(
child: ShowFillButton( child: ShowFillButton(
maxHeight: 55, maxHeight: 55,
title: "Yes", title: LocaleKeys.yes.tr(),
fontSize: 15, fontSize: 15,
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
@ -1180,7 +1172,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
maxHeight: 55, maxHeight: 55,
isFilled: false, isFilled: false,
borderColor: MyColors.darkPrimaryColor, borderColor: MyColors.darkPrimaryColor,
title: "No", title: LocaleKeys.no.tr(),
txtColor: MyColors.darkPrimaryColor, txtColor: MyColors.darkPrimaryColor,
fontSize: 15, fontSize: 15,
onPressed: () { onPressed: () {
@ -1203,31 +1195,31 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
Widget reservedAdActions(context, {required AdDetailsModel adDetailsModel, required AdVM adVM}) { Widget reservedAdActions(context, {required AdDetailsModel adDetailsModel, required AdVM adVM}) {
switch (adDetailsModel.adReserveStatus) { switch (adDetailsModel.adReserveStatus) {
case AdReserveStatus.defaultStatus: case AdReserveStatus.defaultStatus:
return pendingForReviewAction(pendingText: "Waiting for Admins Response"); return pendingForReviewAction(pendingText: LocaleKeys.waitingAdminsResponse.tr());
case AdReserveStatus.reserved: case AdReserveStatus.reserved:
return cancelReservationAction(context, adDetails: adDetailsModel); return cancelReservationAction(context, adDetails: adDetailsModel);
case AdReserveStatus.cancelledByOwner: case AdReserveStatus.cancelledByOwner:
return pendingForReviewAction(pendingText: "Cancelled by Owner"); return pendingForReviewAction(pendingText: LocaleKeys.cancelledByOwner.tr());
case AdReserveStatus.cancelledByAdmin: case AdReserveStatus.cancelledByAdmin:
return pendingForReviewAction(pendingText: "Cancelled by Admin"); return pendingForReviewAction(pendingText: LocaleKeys.cancelledByAdmin.tr());
case AdReserveStatus.timeOver: case AdReserveStatus.timeOver:
return pendingForReviewAction(pendingText: "Reservation Time Over"); return pendingForReviewAction(pendingText: LocaleKeys.reservationTimeOver.tr());
case AdReserveStatus.dealDone: case AdReserveStatus.dealDone:
if (adVM.adsBankDetailsModel != null) { if (adVM.adsBankDetailsModel != null) {
return completeDealAction(context, adDetails: adDetailsModel); return completeDealAction(context, adDetails: adDetailsModel);
} }
return pendingForReviewAction(pendingText: "Waiting for Admins Response"); return pendingForReviewAction(pendingText: LocaleKeys.waitingAdminsResponse.tr());
case AdReserveStatus.fullPaymentVerified: case AdReserveStatus.fullPaymentVerified:
return pendingForReviewAction(pendingText: "Payment Verified"); return pendingForReviewAction(pendingText: LocaleKeys.paymentVerified.tr());
default: default:
return pendingForReviewAction(pendingText: "Waiting for Admins Response"); return pendingForReviewAction(pendingText: LocaleKeys.waitingAdminsResponse.tr());
} }
} }
@ -1248,16 +1240,16 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
case AdPostStatus.buyingService: case AdPostStatus.buyingService:
case AdPostStatus.reserveCancel: case AdPostStatus.reserveCancel:
case AdPostStatus.rejected: case AdPostStatus.rejected:
return pendingForReviewAction(pendingText: "Rejected form admin"); return pendingForReviewAction(pendingText: LocaleKeys.rejectedFormAdmin.tr());
case AdPostStatus.cancelled: case AdPostStatus.cancelled:
case AdPostStatus.pendingForPost: case AdPostStatus.pendingForPost:
return pendingForReviewAction(pendingText: "Waiting for admin to post"); return pendingForReviewAction(pendingText: LocaleKeys.waitingAdminPost.tr());
case AdPostStatus.pendingForReview: case AdPostStatus.pendingForReview:
return pendingForReviewAction(pendingText: "Waiting for Admins Approval"); return pendingForReviewAction(pendingText: LocaleKeys.waitingAdminsApproval.tr());
case AdPostStatus.sold: case AdPostStatus.sold:
return pendingForReviewAction(pendingText: "Sold"); return pendingForReviewAction(pendingText: LocaleKeys.sold.tr());
case AdPostStatus.expired: case AdPostStatus.expired:
return expiredAdAction(context); return expiredAdAction(context);

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:mc_common_app/classes/consts.dart'; import 'package:mc_common_app/classes/consts.dart';
import 'package:mc_common_app/extensions/int_extensions.dart'; import 'package:mc_common_app/extensions/int_extensions.dart';
import 'package:mc_common_app/extensions/string_extensions.dart'; import 'package:mc_common_app/extensions/string_extensions.dart';
import 'package:mc_common_app/generated/locale_keys.g.dart';
import 'package:mc_common_app/models/general_models/widgets_models.dart'; import 'package:mc_common_app/models/general_models/widgets_models.dart';
import 'package:mc_common_app/theme/colors.dart'; import 'package:mc_common_app/theme/colors.dart';
import 'package:mc_common_app/view_models/ad_view_model.dart'; import 'package:mc_common_app/view_models/ad_view_model.dart';
@ -11,6 +12,7 @@ import 'package:mc_common_app/widgets/common_widgets/search_entity_widget.dart';
import 'package:mc_common_app/widgets/dropdown/dropdow_field.dart'; import 'package:mc_common_app/widgets/dropdown/dropdow_field.dart';
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:easy_localization/easy_localization.dart';
class AdsFilterView extends StatelessWidget { class AdsFilterView extends StatelessWidget {
const AdsFilterView({super.key}); const AdsFilterView({super.key});
@ -19,7 +21,7 @@ class AdsFilterView extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: CustomAppBar( appBar: CustomAppBar(
title: "Ads Filter", title: LocaleKeys.adsFilter.tr(),
profileImageUrl: MyAssets.bnCar, profileImageUrl: MyAssets.bnCar,
isRemoveBackButton: false, isRemoveBackButton: false,
isDrawerEnabled: false, isDrawerEnabled: false,
@ -41,7 +43,7 @@ class AdsFilterView extends StatelessWidget {
children: [ children: [
20.height, 20.height,
SearchEntityWidget( SearchEntityWidget(
title: "Search By City", title: LocaleKeys.searchByCity.tr(),
actionWidget: Builder(builder: (context) { actionWidget: Builder(builder: (context) {
List<DropValue> vehicleBrandsDrop = []; List<DropValue> vehicleBrandsDrop = [];
for (var element in adVM.vehicleCities) { for (var element in adVM.vehicleCities) {
@ -51,7 +53,7 @@ class AdsFilterView extends StatelessWidget {
(DropValue value) => adVM.updateSelectionVehicleCityId(SelectionModel(selectedId: value.id, selectedOption: value.value), isForSearch: true), (DropValue value) => adVM.updateSelectionVehicleCityId(SelectionModel(selectedId: value.id, selectedOption: value.value), isForSearch: true),
list: vehicleBrandsDrop, list: vehicleBrandsDrop,
dropdownValue: adVM.vehicleCityId.selectedId != -1 ? DropValue(adVM.vehicleCityId.selectedId, adVM.vehicleCityId.selectedOption, "") : null, dropdownValue: adVM.vehicleCityId.selectedId != -1 ? DropValue(adVM.vehicleCityId.selectedId, adVM.vehicleCityId.selectedOption, "") : null,
hint: "Select City", hint: LocaleKeys.selectCity.tr(),
errorValue: adVM.vehicleCityId.errorValue, errorValue: adVM.vehicleCityId.errorValue,
); );
}), }),
@ -61,7 +63,7 @@ class AdsFilterView extends StatelessWidget {
), ),
const Divider(thickness: 1.2).paddingOnly(top: 7, bottom: 7), const Divider(thickness: 1.2).paddingOnly(top: 7, bottom: 7),
SearchEntityWidget( SearchEntityWidget(
title: "Search By Brand Name", title: LocaleKeys.searchByBrandName.tr(),
actionWidget: Builder(builder: (context) { actionWidget: Builder(builder: (context) {
List<DropValue> vehicleBrandsDrop = []; List<DropValue> vehicleBrandsDrop = [];
for (var element in adVM.vehicleBrands) { for (var element in adVM.vehicleBrands) {
@ -71,7 +73,7 @@ class AdsFilterView extends StatelessWidget {
(DropValue value) => adVM.updateSelectionVehicleBrandId(SelectionModel(selectedId: value.id, selectedOption: value.value), isForSearch: true), (DropValue value) => adVM.updateSelectionVehicleBrandId(SelectionModel(selectedId: value.id, selectedOption: value.value), isForSearch: true),
list: vehicleBrandsDrop, list: vehicleBrandsDrop,
dropdownValue: adVM.vehicleBrandId.selectedId != -1 ? DropValue(adVM.vehicleBrandId.selectedId, adVM.vehicleBrandId.selectedOption, "") : null, dropdownValue: adVM.vehicleBrandId.selectedId != -1 ? DropValue(adVM.vehicleBrandId.selectedId, adVM.vehicleBrandId.selectedOption, "") : null,
hint: "Select Vehicle Brand", hint: LocaleKeys.selectVehicleBrand.tr(),
errorValue: adVM.vehicleBrandId.errorValue, errorValue: adVM.vehicleBrandId.errorValue,
); );
}), }),
@ -81,7 +83,7 @@ class AdsFilterView extends StatelessWidget {
), ),
const Divider(thickness: 1.2).paddingOnly(top: 7, bottom: 7), const Divider(thickness: 1.2).paddingOnly(top: 7, bottom: 7),
SearchEntityWidget( SearchEntityWidget(
title: "Search By Vehicle Year", title: LocaleKeys.searchByVehicleYear.tr(),
actionWidget: Builder(builder: (context) { actionWidget: Builder(builder: (context) {
List<DropValue> vehicleBrandsDrop = []; List<DropValue> vehicleBrandsDrop = [];
for (var element in adVM.vehicleModelYears) { for (var element in adVM.vehicleModelYears) {
@ -91,7 +93,7 @@ class AdsFilterView extends StatelessWidget {
(DropValue value) => adVM.updateSelectionVehicleModelYearId(SelectionModel(selectedId: value.id, selectedOption: value.value), isForSearch: true), (DropValue value) => adVM.updateSelectionVehicleModelYearId(SelectionModel(selectedId: value.id, selectedOption: value.value), isForSearch: true),
list: vehicleBrandsDrop, list: vehicleBrandsDrop,
dropdownValue: adVM.vehicleModelYearId.selectedId != -1 ? DropValue(adVM.vehicleModelYearId.selectedId, adVM.vehicleModelYearId.selectedOption, "") : null, dropdownValue: adVM.vehicleModelYearId.selectedId != -1 ? DropValue(adVM.vehicleModelYearId.selectedId, adVM.vehicleModelYearId.selectedOption, "") : null,
hint: "Select Year", hint: LocaleKeys.selectYear.tr(),
errorValue: adVM.vehicleModelYearId.errorValue, errorValue: adVM.vehicleModelYearId.errorValue,
); );
}), }),
@ -101,7 +103,7 @@ class AdsFilterView extends StatelessWidget {
), ),
const Divider(thickness: 1.2).paddingOnly(top: 7, bottom: 7), const Divider(thickness: 1.2).paddingOnly(top: 7, bottom: 7),
SearchEntityWidget( SearchEntityWidget(
title: "Search By Ad Owner", title: LocaleKeys.searchByAdOwner.tr(),
actionWidget: Builder(builder: (context) { actionWidget: Builder(builder: (context) {
List<DropValue> vehicleOwnerDrop = []; List<DropValue> vehicleOwnerDrop = [];
for (var element in adVM.exploreAdsEnums) { for (var element in adVM.exploreAdsEnums) {
@ -111,7 +113,7 @@ class AdsFilterView extends StatelessWidget {
(DropValue value) => adVM.updateSelectionVehicleAdOwnerId(SelectionModel(selectedId: value.id, selectedOption: value.value), isForSearch: true), (DropValue value) => adVM.updateSelectionVehicleAdOwnerId(SelectionModel(selectedId: value.id, selectedOption: value.value), isForSearch: true),
list: vehicleOwnerDrop, list: vehicleOwnerDrop,
dropdownValue: adVM.vehicleOwnerId.selectedId != -1 ? DropValue(adVM.vehicleOwnerId.selectedId, adVM.vehicleOwnerId.selectedOption, "") : null, dropdownValue: adVM.vehicleOwnerId.selectedId != -1 ? DropValue(adVM.vehicleOwnerId.selectedId, adVM.vehicleOwnerId.selectedOption, "") : null,
hint: "Select Owner", hint: LocaleKeys.selectOwner.tr(),
errorValue: adVM.vehicleOwnerId.errorValue, errorValue: adVM.vehicleOwnerId.errorValue,
); );
}), }),
@ -131,7 +133,7 @@ class AdsFilterView extends StatelessWidget {
Expanded( Expanded(
child: ShowFillButton( child: ShowFillButton(
maxHeight: 55, maxHeight: 55,
title: "Search", title: LocaleKeys.search.tr(),
onPressed: () { onPressed: () {
adVM.getAdsBasedOnFilters(); adVM.getAdsBasedOnFilters();
}, },
@ -145,7 +147,7 @@ class AdsFilterView extends StatelessWidget {
8.height, 8.height,
InkWell( InkWell(
onTap: () => adVM.clearAdsFilters(), onTap: () => adVM.clearAdsFilters(),
child: "Clear Filters".toText( child: LocaleKeys.clearFilters.tr().toText(
fontSize: 14, fontSize: 14,
isBold: true, isBold: true,
color: MyColors.darkPrimaryColor, color: MyColors.darkPrimaryColor,

@ -3,6 +3,7 @@ import 'package:mc_common_app/classes/consts.dart';
import 'package:mc_common_app/config/routes.dart'; import 'package:mc_common_app/config/routes.dart';
import 'package:mc_common_app/extensions/int_extensions.dart'; import 'package:mc_common_app/extensions/int_extensions.dart';
import 'package:mc_common_app/extensions/string_extensions.dart'; import 'package:mc_common_app/extensions/string_extensions.dart';
import 'package:mc_common_app/generated/locale_keys.g.dart';
import 'package:mc_common_app/models/advertisment_models/ad_details_model.dart'; import 'package:mc_common_app/models/advertisment_models/ad_details_model.dart';
import 'package:mc_common_app/theme/colors.dart'; import 'package:mc_common_app/theme/colors.dart';
import 'package:mc_common_app/utils/navigator.dart'; import 'package:mc_common_app/utils/navigator.dart';
@ -10,6 +11,8 @@ import 'package:mc_common_app/utils/utils.dart';
import 'package:mc_common_app/view_models/ad_view_model.dart'; import 'package:mc_common_app/view_models/ad_view_model.dart';
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:easy_localization/easy_localization.dart';
class BuildAdsList extends StatelessWidget { class BuildAdsList extends StatelessWidget {
final List<AdDetailsModel> adsList; final List<AdDetailsModel> adsList;
@ -31,7 +34,7 @@ class BuildAdsList extends StatelessWidget {
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
"No Ads to show.".toText(fontSize: 16, color: MyColors.lightTextColor), LocaleKeys.noAdsShow.tr().toText(fontSize: 16, color: MyColors.lightTextColor),
], ],
); );
} }
@ -101,7 +104,7 @@ class AdCard extends StatelessWidget {
(adDetails.vehicle!.vehicleTitle ?? "").toText(fontSize: 16, isBold: true), (adDetails.vehicle!.vehicleTitle ?? "").toText(fontSize: 16, isBold: true),
Row( Row(
children: [ children: [
"Model:".toText( (LocaleKeys.model.tr() + ":").toText(
color: MyColors.lightTextColor, color: MyColors.lightTextColor,
), ),
2.width, 2.width,
@ -110,7 +113,7 @@ class AdCard extends StatelessWidget {
), ),
Row( Row(
children: [ children: [
"Mileage:".toText( (LocaleKeys.mileage.tr() + ":").toText(
color: MyColors.lightTextColor, color: MyColors.lightTextColor,
), ),
2.width, 2.width,
@ -146,7 +149,7 @@ class AdCard extends StatelessWidget {
children: [ children: [
(adDetails.vehicle!.demandAmount!.toInt().toString()).toText(fontSize: 16, isBold: true), (adDetails.vehicle!.demandAmount!.toInt().toString()).toText(fontSize: 16, isBold: true),
2.width, 2.width,
"SAR".toText( LocaleKeys.sar.tr().toText(
color: MyColors.lightTextColor, color: MyColors.lightTextColor,
), ),
], ],

@ -1,6 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:mc_common_app/extensions/int_extensions.dart'; import 'package:mc_common_app/extensions/int_extensions.dart';
import 'package:mc_common_app/extensions/string_extensions.dart'; import 'package:mc_common_app/extensions/string_extensions.dart';
import 'package:mc_common_app/generated/locale_keys.g.dart';
import 'package:mc_common_app/models/advertisment_models/vehicle_details_models.dart'; import 'package:mc_common_app/models/advertisment_models/vehicle_details_models.dart';
import 'package:mc_common_app/models/general_models/widgets_models.dart'; import 'package:mc_common_app/models/general_models/widgets_models.dart';
import 'package:mc_common_app/theme/colors.dart'; import 'package:mc_common_app/theme/colors.dart';
@ -12,6 +13,7 @@ import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
import 'package:mc_common_app/widgets/txt_field.dart'; import 'package:mc_common_app/widgets/txt_field.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:sizer/sizer.dart'; import 'package:sizer/sizer.dart';
import 'package:easy_localization/easy_localization.dart';
class BottomSheetListContent extends StatefulWidget { class BottomSheetListContent extends StatefulWidget {
const BottomSheetListContent({Key? key}) : super(key: key); const BottomSheetListContent({Key? key}) : super(key: key);
@ -40,14 +42,14 @@ class _BottomSheetListContentState extends State<BottomSheetListContent> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
"Damage Part List".toText(fontSize: 24, isBold: true), LocaleKeys.damagePartList.tr().toText(fontSize: 24, isBold: true),
], ],
), ),
8.height, 8.height,
TxtField( TxtField(
value: adVM.damagePartSearchValue, value: adVM.damagePartSearchValue,
errorValue: "", errorValue: "",
hint: "Search Part", hint: LocaleKeys.searchPart.tr(),
onChanged: (value) { onChanged: (value) {
adVM.onSearchChangedForDamagePart(value); adVM.onSearchChangedForDamagePart(value);
}, },
@ -118,7 +120,7 @@ class _BottomSheetListContentState extends State<BottomSheetListContent> {
SizedBox( SizedBox(
width: double.infinity, width: double.infinity,
child: ShowFillButton( child: ShowFillButton(
title: "Add Damage Part", title: LocaleKeys.addDamagePart.tr(),
onPressed: () { onPressed: () {
for (var value in adVM.vehicleDamageParts) { for (var value in adVM.vehicleDamageParts) {
if (value.isChecked! && !value.isSelected!) { if (value.isChecked! && !value.isSelected!) {
@ -191,7 +193,7 @@ class BottomSheetAdSpecialServiceContent extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
"Add Special Service".toText(fontSize: 24, isBold: true), LocaleKeys.addSpecialService.tr().toText(fontSize: 24, isBold: true),
8.height, 8.height,
Builder( Builder(
builder: (context) { builder: (context) {
@ -204,7 +206,7 @@ class BottomSheetAdSpecialServiceContent extends StatelessWidget {
return DropdownField( return DropdownField(
(DropValue value) => adVM.updateVehicleAdsSpecialServicesId(SelectionModel(selectedId: value.id, selectedOption: value.value, itemPrice: value.subValue)), (DropValue value) => adVM.updateVehicleAdsSpecialServicesId(SelectionModel(selectedId: value.id, selectedOption: value.value, itemPrice: value.subValue)),
list: vehicleAdsSpecialServices, list: vehicleAdsSpecialServices,
hint: "Select Service", hint: LocaleKeys.selectService.tr(),
dropdownValue: dropdownValue:
adVM.vehicleAdsSpecialServicesId.selectedId != -1 ? DropValue(adVM.vehicleAdsSpecialServicesId.selectedId, adVM.vehicleAdsSpecialServicesId.selectedOption, "") : null, adVM.vehicleAdsSpecialServicesId.selectedId != -1 ? DropValue(adVM.vehicleAdsSpecialServicesId.selectedId, adVM.vehicleAdsSpecialServicesId.selectedOption, "") : null,
); );
@ -269,7 +271,7 @@ class BottomSheetAdSpecialServiceContent extends StatelessWidget {
), ),
], ],
if (adVM.adSSTimeSlots.isNotEmpty) ...[ if (adVM.adSSTimeSlots.isNotEmpty) ...[
"Available slots".toText(fontSize: 15, isBold: true), LocaleKeys.availableSlots.tr().toText(fontSize: 15, isBold: true),
8.height, 8.height,
BuildTimeSlots( BuildTimeSlots(
timeSlots: adVM.adSSTimeSlots, timeSlots: adVM.adSSTimeSlots,
@ -277,13 +279,13 @@ class BottomSheetAdSpecialServiceContent extends StatelessWidget {
), ),
], ],
22.height, 22.height,
"Service Amount".toText(fontSize: 16, isBold: true, color: MyColors.lightTextColor), LocaleKeys.serviceAmount.tr().toText(fontSize: 16, isBold: true, color: MyColors.lightTextColor),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
adVM.vehicleAdsSpecialServicesId.itemPrice.toText(fontSize: 20, isBold: true), adVM.vehicleAdsSpecialServicesId.itemPrice.toText(fontSize: 20, isBold: true),
SizedBox(width: 1.w), SizedBox(width: 1.w),
"SAR".toText(fontSize: 12, isBold: true, color: MyColors.lightTextColor).paddingOnly(bottom: 2), LocaleKeys.sar.tr().toText(fontSize: 12, isBold: true, color: MyColors.lightTextColor).paddingOnly(bottom: 2),
], ],
), ),
], ],
@ -295,7 +297,7 @@ class BottomSheetAdSpecialServiceContent extends StatelessWidget {
width: double.infinity, width: double.infinity,
child: ShowFillButton( child: ShowFillButton(
backgroundColor: !isButtonTappable(adVM) ? MyColors.lightTextColor.withOpacity(0.6) : MyColors.primaryColor, backgroundColor: !isButtonTappable(adVM) ? MyColors.lightTextColor.withOpacity(0.6) : MyColors.primaryColor,
title: "Add Service", title: LocaleKeys.addService.tr(),
onPressed: () { onPressed: () {
if (!isButtonTappable(adVM)) { if (!isButtonTappable(adVM)) {
return; return;

@ -2,11 +2,13 @@ import 'package:flutter/material.dart';
import 'package:mc_common_app/classes/consts.dart'; import 'package:mc_common_app/classes/consts.dart';
import 'package:mc_common_app/extensions/int_extensions.dart'; import 'package:mc_common_app/extensions/int_extensions.dart';
import 'package:mc_common_app/extensions/string_extensions.dart'; import 'package:mc_common_app/extensions/string_extensions.dart';
import 'package:mc_common_app/generated/locale_keys.g.dart';
import 'package:mc_common_app/theme/colors.dart'; import 'package:mc_common_app/theme/colors.dart';
import 'package:mc_common_app/utils/enums.dart'; import 'package:mc_common_app/utils/enums.dart';
import 'package:mc_common_app/view_models/ad_view_model.dart'; import 'package:mc_common_app/view_models/ad_view_model.dart';
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:easy_localization/easy_localization.dart';
class CreateAdProgressSteps extends StatelessWidget { class CreateAdProgressSteps extends StatelessWidget {
const CreateAdProgressSteps({Key? key}) : super(key: key); const CreateAdProgressSteps({Key? key}) : super(key: key);
@ -66,10 +68,10 @@ class CreateAdProgressSteps extends StatelessWidget {
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
buildStep(MyAssets.carIcon, "Vehicle \n Details", getProgressStepNumber(currentStep: adVM.currentProgressStep) >= 1), buildStep(MyAssets.carIcon, (LocaleKeys.vehicleVar.tr() + " \n" + LocaleKeys.detailsVar.tr()), getProgressStepNumber(currentStep: adVM.currentProgressStep) >= 1),
buildStep(MyAssets.carHitIcon, "Damage \n Parts", getProgressStepNumber(currentStep: adVM.currentProgressStep) >= 2), buildStep(MyAssets.carHitIcon, (LocaleKeys.damageVar.tr() + " \n" + LocaleKeys.partsVar.tr()), getProgressStepNumber(currentStep: adVM.currentProgressStep) >= 2),
buildStep(MyAssets.clockIcon, "Additional \n Details", getProgressStepNumber(currentStep: adVM.currentProgressStep) >= 3), buildStep(MyAssets.clockIcon, (LocaleKeys.additional.tr() + " \n" + LocaleKeys.detailsVar.tr()), getProgressStepNumber(currentStep: adVM.currentProgressStep) >= 3),
buildStep(MyAssets.reviewIcon, "Review \n Ad", getProgressStepNumber(currentStep: adVM.currentProgressStep) >= 4), buildStep(MyAssets.reviewIcon, (LocaleKeys.review.tr() + " \n"+ LocaleKeys.adVar.tr()), getProgressStepNumber(currentStep: adVM.currentProgressStep) >= 4),
], ],
), ),
], ],

@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:mc_common_app/extensions/int_extensions.dart'; import 'package:mc_common_app/extensions/int_extensions.dart';
import 'package:mc_common_app/generated/locale_keys.g.dart';
import 'package:mc_common_app/theme/colors.dart'; import 'package:mc_common_app/theme/colors.dart';
import 'package:mc_common_app/utils/enums.dart'; import 'package:mc_common_app/utils/enums.dart';
import 'package:mc_common_app/utils/navigator.dart'; import 'package:mc_common_app/utils/navigator.dart';
@ -13,6 +14,8 @@ import 'package:mc_common_app/widgets/button/show_fill_button.dart';
import 'package:mc_common_app/widgets/common_widgets/app_bar.dart'; import 'package:mc_common_app/widgets/common_widgets/app_bar.dart';
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:easy_localization/easy_localization.dart';
class CreateAdView extends StatefulWidget { class CreateAdView extends StatefulWidget {
const CreateAdView({Key? key}) : super(key: key); const CreateAdView({Key? key}) : super(key: key);
@ -34,7 +37,7 @@ class _CreateAdViewState extends State<CreateAdView> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: CustomAppBar( appBar: CustomAppBar(
title: adVM.isAdEditEnabled ? "Update Ad": "Create Ad", title: adVM.isAdEditEnabled ? LocaleKeys.updateAd.tr(): LocaleKeys.createAd.tr(),
isRemoveBackButton: false, isRemoveBackButton: false,
isDrawerEnabled: false, isDrawerEnabled: false,
onBackButtonTapped: () => adVM.onBackButtonPressed(context), onBackButtonTapped: () => adVM.onBackButtonPressed(context),
@ -77,7 +80,7 @@ class BuildFooterButton extends StatelessWidget {
return SizedBox( return SizedBox(
width: double.infinity, width: double.infinity,
child: ShowFillButton( child: ShowFillButton(
title: "Next", title: LocaleKeys.next.tr(),
onPressed: () { onPressed: () {
adVm.updateCurrentStep(context); adVm.updateCurrentStep(context);
}, },
@ -90,7 +93,7 @@ class BuildFooterButton extends StatelessWidget {
child: ShowFillButton( child: ShowFillButton(
txtColor: MyColors.black, txtColor: MyColors.black,
maxHeight: 55, maxHeight: 55,
title: "Cancel", title: LocaleKeys.cancel.tr(),
onPressed: () { onPressed: () {
adVm.resetValues(); adVm.resetValues();
pop(context); pop(context);
@ -102,7 +105,7 @@ class BuildFooterButton extends StatelessWidget {
Expanded( Expanded(
child: ShowFillButton( child: ShowFillButton(
maxHeight: 55, maxHeight: 55,
title: "Next", title: LocaleKeys.next.tr(),
onPressed: () { onPressed: () {
adVm.updateCurrentStep(context); adVm.updateCurrentStep(context);
}, },
@ -118,7 +121,7 @@ class BuildFooterButton extends StatelessWidget {
child: ShowFillButton( child: ShowFillButton(
txtColor: MyColors.black, txtColor: MyColors.black,
maxHeight: 55, maxHeight: 55,
title: "Cancel", title: LocaleKeys.cancel.tr(),
onPressed: () { onPressed: () {
adVm.resetValues(); adVm.resetValues();
pop(context); pop(context);
@ -130,7 +133,7 @@ class BuildFooterButton extends StatelessWidget {
Expanded( Expanded(
child: ShowFillButton( child: ShowFillButton(
maxHeight: 55, maxHeight: 55,
title: "Next", title: LocaleKeys.next.tr(),
onPressed: () { onPressed: () {
adVm.updateCurrentStep(context); adVm.updateCurrentStep(context);
}, },
@ -146,7 +149,7 @@ class BuildFooterButton extends StatelessWidget {
child: ShowFillButton( child: ShowFillButton(
txtColor: MyColors.black, txtColor: MyColors.black,
maxHeight: 55, maxHeight: 55,
title: "Cancel", title: LocaleKeys.cancel.tr(),
onPressed: () { onPressed: () {
adVm.resetValues(); adVm.resetValues();
pop(context); pop(context);
@ -158,7 +161,7 @@ class BuildFooterButton extends StatelessWidget {
Expanded( Expanded(
child: ShowFillButton( child: ShowFillButton(
maxHeight: 55, maxHeight: 55,
title: "Submit Ad", title: LocaleKeys.submitAd.tr(),
onPressed: () { onPressed: () {
adVm.updateCurrentStep(context); adVm.updateCurrentStep(context);
}, },

@ -3,6 +3,7 @@ import 'package:mc_common_app/classes/consts.dart';
import 'package:mc_common_app/config/routes.dart'; import 'package:mc_common_app/config/routes.dart';
import 'package:mc_common_app/extensions/int_extensions.dart'; import 'package:mc_common_app/extensions/int_extensions.dart';
import 'package:mc_common_app/extensions/string_extensions.dart'; import 'package:mc_common_app/extensions/string_extensions.dart';
import 'package:mc_common_app/generated/locale_keys.g.dart';
import 'package:mc_common_app/main.dart'; import 'package:mc_common_app/main.dart';
import 'package:mc_common_app/models/advertisment_models/vehicle_details_models.dart'; import 'package:mc_common_app/models/advertisment_models/vehicle_details_models.dart';
import 'package:mc_common_app/models/general_models/widgets_models.dart'; import 'package:mc_common_app/models/general_models/widgets_models.dart';
@ -14,6 +15,8 @@ import 'package:mc_common_app/widgets/bottom_sheet.dart';
import 'package:mc_common_app/widgets/common_widgets/app_bar.dart'; import 'package:mc_common_app/widgets/common_widgets/app_bar.dart';
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:easy_localization/easy_localization.dart';
class SelectAdTypeView extends StatelessWidget { class SelectAdTypeView extends StatelessWidget {
final bool isProvider; final bool isProvider;
@ -61,7 +64,7 @@ class SelectAdTypeView extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: CustomAppBar( appBar: CustomAppBar(
title: "Select Ad Type", title: LocaleKeys.selectAdType.tr(),
profileImageUrl: MyAssets.bnCar, profileImageUrl: MyAssets.bnCar,
isRemoveBackButton: false, isRemoveBackButton: false,
isDrawerEnabled: false, isDrawerEnabled: false,
@ -106,14 +109,14 @@ class SelectAdTypeView extends StatelessWidget {
if (isProvider) ...[ if (isProvider) ...[
Row( Row(
children: [ children: [
"Duration: ".toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true), LocaleKeys.duration.tr().toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true),
"Valid Until Subscription Expiration".toText(fontSize: 13, isBold: true), LocaleKeys.validUntilSubscriptionExpiration.tr() .toText(fontSize: 13, isBold: true),
], ],
).paddingOnly(top: 5, bottom: 5), ).paddingOnly(top: 5, bottom: 5),
] else ...[ ] else ...[
Row( Row(
children: [ children: [
"Duration: ".toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true), LocaleKeys.duration.tr().toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true),
adVM.vehicleAdDurationId.selectedOption.toText(fontSize: 13, isBold: true), adVM.vehicleAdDurationId.selectedOption.toText(fontSize: 13, isBold: true),
const Icon(Icons.keyboard_arrow_down_sharp, color: MyColors.darkPrimaryColor, size: 20), const Icon(Icons.keyboard_arrow_down_sharp, color: MyColors.darkPrimaryColor, size: 20),
], ],
@ -127,7 +130,7 @@ class SelectAdTypeView extends StatelessWidget {
2.width, 2.width,
Padding( Padding(
padding: const EdgeInsets.only(bottom: 4), padding: const EdgeInsets.only(bottom: 4),
child: "SAR".toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true), child: LocaleKeys.sar.tr().toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true),
), ),
], ],
), ),
@ -154,21 +157,21 @@ class SelectAdTypeView extends StatelessWidget {
Row( Row(
children: [ children: [
"5 of 10 ".toText(fontSize: 29, isBold: true, letterSpacing: 0, height: 1), "5 of 10 ".toText(fontSize: 29, isBold: true, letterSpacing: 0, height: 1),
"Ads Remaining ".toText(fontSize: 17, color: MyColors.lightTextColor, isBold: true), LocaleKeys.adsRemaining.tr().toText(fontSize: 17, color: MyColors.lightTextColor, isBold: true),
], ],
), ),
const Text.rich( Text.rich(
TextSpan( TextSpan(
children: [ children: [
TextSpan( TextSpan(
text: "You have left with 05 out of 50 ads given in the subscription. ", text: LocaleKeys.youLeftAdsGivenSubscription.tr(),
style: TextStyle( style: const TextStyle(
fontSize: 14, fontSize: 14,
color: MyColors.lightTextColor, color: MyColors.lightTextColor,
)), )),
TextSpan( TextSpan(
text: "Update Subscription", text: LocaleKeys.updateSubscription.tr(),
style: TextStyle( style: const TextStyle(
decoration: TextDecoration.underline, decoration: TextDecoration.underline,
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:mc_common_app/classes/consts.dart'; import 'package:mc_common_app/classes/consts.dart';
import 'package:mc_common_app/extensions/int_extensions.dart'; import 'package:mc_common_app/extensions/int_extensions.dart';
import 'package:mc_common_app/extensions/string_extensions.dart'; import 'package:mc_common_app/extensions/string_extensions.dart';
import 'package:mc_common_app/generated/locale_keys.g.dart';
import 'package:mc_common_app/models/appointments_models/appointment_list_model.dart'; import 'package:mc_common_app/models/appointments_models/appointment_list_model.dart';
import 'package:mc_common_app/models/services_models/service_model.dart'; import 'package:mc_common_app/models/services_models/service_model.dart';
import 'package:mc_common_app/theme/colors.dart'; import 'package:mc_common_app/theme/colors.dart';
@ -13,6 +14,8 @@ import 'package:mc_common_app/widgets/common_widgets/app_bar.dart';
import 'package:mc_common_app/widgets/common_widgets/card_button_with_icon.dart'; import 'package:mc_common_app/widgets/common_widgets/card_button_with_icon.dart';
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:easy_localization/easy_localization.dart';
class AppointmentDetailView extends StatelessWidget { class AppointmentDetailView extends StatelessWidget {
final AppointmentListModel appointmentListModel; final AppointmentListModel appointmentListModel;
@ -47,7 +50,7 @@ class AppointmentDetailView extends StatelessWidget {
color: MyColors.grey98Color.withOpacity(0.3), color: MyColors.grey98Color.withOpacity(0.3),
textColor: MyColors.lightTextColor, textColor: MyColors.lightTextColor,
onPressed: () {}, onPressed: () {},
text: "Work In Progress", text: LocaleKeys.workInProgress.tr(),
), ),
], ],
), ),
@ -68,7 +71,7 @@ class AppointmentDetailView extends StatelessWidget {
); );
} }
}, },
text: "Pay Now", text: LocaleKeys.payNow.tr(),
), ),
], ],
), ),
@ -90,7 +93,7 @@ class AppointmentDetailView extends StatelessWidget {
onPressed: () { onPressed: () {
context.read<AppointmentsVM>().onConfirmAppointmentPressed(context: context, appointmentId: appointmentListModel.id); context.read<AppointmentsVM>().onConfirmAppointmentPressed(context: context, appointmentId: appointmentListModel.id);
}, },
text: "Confirm"), text: LocaleKeys.confirm.tr()),
], ],
), ),
); );
@ -112,7 +115,7 @@ class AppointmentDetailView extends StatelessWidget {
color: MyColors.grey98Color.withOpacity(0.3), color: MyColors.grey98Color.withOpacity(0.3),
textColor: MyColors.lightTextColor, textColor: MyColors.lightTextColor,
onPressed: () {}, onPressed: () {},
text: "Visit Completed", text: LocaleKeys.visitCompleted.tr(),
), ),
], ],
), ),
@ -144,7 +147,7 @@ class AppointmentDetailView extends StatelessWidget {
onPressed: () { onPressed: () {
context.read<AppointmentsVM>().onConfirmAppointmentPressed(context: context, appointmentId: appointmentListModel.id); context.read<AppointmentsVM>().onConfirmAppointmentPressed(context: context, appointmentId: appointmentListModel.id);
}, },
text: "Confirm"), text: LocaleKeys.confirm.tr()),
], ],
), ),
); );
@ -157,12 +160,12 @@ class AppointmentDetailView extends StatelessWidget {
final appointmentsVm = context.read<AppointmentsVM>(); final appointmentsVm = context.read<AppointmentsVM>();
return actionConfirmationBottomSheet( return actionConfirmationBottomSheet(
context: context, context: context,
title: "Do you want to cancel this appointment?".toText(fontSize: 28, isBold: true, letterSpacing: -1.44), title: LocaleKeys.youWantCancelAppointment.tr().toText(fontSize: 28, isBold: true, letterSpacing: -1.44),
subtitle: "Your appointment will be cancelled and you cannot undo this action.", subtitle: LocaleKeys.appointmentCancelledCannotUndoAction.tr(),
actionButtonYes: Expanded( actionButtonYes: Expanded(
child: ShowFillButton( child: ShowFillButton(
maxHeight: 55, maxHeight: 55,
title: "Yes", title: LocaleKeys.yes.tr(),
fontSize: 15, fontSize: 15,
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
@ -175,7 +178,7 @@ class AppointmentDetailView extends StatelessWidget {
maxHeight: 55, maxHeight: 55,
isFilled: false, isFilled: false,
borderColor: MyColors.darkPrimaryColor, borderColor: MyColors.darkPrimaryColor,
title: "No", title: LocaleKeys.no.tr(),
txtColor: MyColors.darkPrimaryColor, txtColor: MyColors.darkPrimaryColor,
fontSize: 15, fontSize: 15,
onPressed: () { onPressed: () {
@ -191,7 +194,7 @@ class AppointmentDetailView extends StatelessWidget {
AppointmentsVM appointmentsVM = context.read<AppointmentsVM>(); AppointmentsVM appointmentsVM = context.read<AppointmentsVM>();
return Scaffold( return Scaffold(
appBar: CustomAppBar( appBar: CustomAppBar(
title: "Appointment", title: LocaleKeys.appointment.tr(),
profileImageUrl: MyAssets.bnCar, profileImageUrl: MyAssets.bnCar,
isRemoveBackButton: false, isRemoveBackButton: false,
isDrawerEnabled: false, isDrawerEnabled: false,
@ -254,7 +257,7 @@ class AppointmentDetailView extends StatelessWidget {
children: [ children: [
((service.currentTotalServicePrice).toString()).toText(fontSize: 25, isBold: true), ((service.currentTotalServicePrice).toString()).toText(fontSize: 25, isBold: true),
2.width, 2.width,
"SAR".toText(color: MyColors.lightTextColor, fontSize: 16, isBold: true).paddingOnly(bottom: 5), LocaleKeys.sar.tr().toText(color: MyColors.lightTextColor, fontSize: 16, isBold: true).paddingOnly(bottom: 5),
const Icon(Icons.arrow_drop_down, size: 30) const Icon(Icons.arrow_drop_down, size: 30)
], ],
).onPress(() => appointmentsVM.priceBreakDownClicked(context, service)), ).onPress(() => appointmentsVM.priceBreakDownClicked(context, service)),
@ -268,7 +271,7 @@ class AppointmentDetailView extends StatelessWidget {
Row( Row(
children: [ children: [
CardButtonWithIcon( CardButtonWithIcon(
title: "Reschedule Appointment", title: LocaleKeys.rescheduleAppointment.tr(),
onCardTapped: () { onCardTapped: () {
context.read<AppointmentsVM>().onRescheduleAppointmentPressed(context: context, appointmentListModel: appointmentListModel); context.read<AppointmentsVM>().onRescheduleAppointmentPressed(context: context, appointmentListModel: appointmentListModel);
}, },
@ -277,7 +280,7 @@ class AppointmentDetailView extends StatelessWidget {
if (appointmentListModel.appointmentStatusEnum == AppointmentStatusEnum.booked) ...[ if (appointmentListModel.appointmentStatusEnum == AppointmentStatusEnum.booked) ...[
10.width, 10.width,
CardButtonWithIcon( CardButtonWithIcon(
title: "Pay for Appointment", title: LocaleKeys.payforAppointment.tr(),
onCardTapped: () { onCardTapped: () {
context.read<AppointmentsVM>().onConfirmAppointmentPressed(context: context, appointmentId: appointmentListModel.id); context.read<AppointmentsVM>().onConfirmAppointmentPressed(context: context, appointmentId: appointmentListModel.id);
}, },

@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:mc_common_app/classes/consts.dart'; import 'package:mc_common_app/classes/consts.dart';
import 'package:mc_common_app/extensions/int_extensions.dart'; import 'package:mc_common_app/extensions/int_extensions.dart';
import 'package:mc_common_app/extensions/string_extensions.dart'; import 'package:mc_common_app/extensions/string_extensions.dart';
import 'package:mc_common_app/generated/locale_keys.g.dart';
import 'package:mc_common_app/models/general_models/widgets_models.dart'; import 'package:mc_common_app/models/general_models/widgets_models.dart';
import 'package:mc_common_app/theme/colors.dart'; import 'package:mc_common_app/theme/colors.dart';
import 'package:mc_common_app/utils/enums.dart'; import 'package:mc_common_app/utils/enums.dart';
@ -12,7 +13,7 @@ import 'package:mc_common_app/view_models/appointments_view_model.dart';
import 'package:mc_common_app/widgets/button/show_fill_button.dart'; import 'package:mc_common_app/widgets/button/show_fill_button.dart';
import 'package:mc_common_app/widgets/common_widgets/app_bar.dart'; import 'package:mc_common_app/widgets/common_widgets/app_bar.dart';
import 'package:mc_common_app/widgets/common_widgets/search_entity_widget.dart'; import 'package:mc_common_app/widgets/common_widgets/search_entity_widget.dart';
import 'package:mc_common_app/widgets/common_widgets/slider_widget.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:mc_common_app/widgets/dropdown/dropdow_field.dart'; import 'package:mc_common_app/widgets/dropdown/dropdow_field.dart';
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -47,7 +48,7 @@ class _AppointmentsFilterViewState extends State<AppointmentsFilterView> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: CustomAppBar( appBar: CustomAppBar(
title: "Appointments Filter", title: LocaleKeys.appointmentsFilter.tr(),
profileImageUrl: MyAssets.bnCar, profileImageUrl: MyAssets.bnCar,
isRemoveBackButton: false, isRemoveBackButton: false,
isDrawerEnabled: false, isDrawerEnabled: false,
@ -69,7 +70,7 @@ class _AppointmentsFilterViewState extends State<AppointmentsFilterView> {
children: [ children: [
20.height, 20.height,
SearchEntityWidget( SearchEntityWidget(
title: "Search By Provider", title: LocaleKeys.searchByProvider.tr(),
actionWidget: Builder( actionWidget: Builder(
builder: (context) { builder: (context) {
return DropdownField( return DropdownField(
@ -78,7 +79,7 @@ class _AppointmentsFilterViewState extends State<AppointmentsFilterView> {
dropdownValue: appointmentsVM.appointmentFilterSelectedProviderId.selectedId != -1 dropdownValue: appointmentsVM.appointmentFilterSelectedProviderId.selectedId != -1
? DropValue(appointmentsVM.appointmentFilterSelectedProviderId.selectedId, appointmentsVM.appointmentFilterSelectedProviderId.selectedOption, "") ? DropValue(appointmentsVM.appointmentFilterSelectedProviderId.selectedId, appointmentsVM.appointmentFilterSelectedProviderId.selectedOption, "")
: null, : null,
hint: "Select Provider", hint: LocaleKeys.selectProvider.tr(),
); );
}, },
), ),
@ -103,7 +104,7 @@ class _AppointmentsFilterViewState extends State<AppointmentsFilterView> {
if (appointmentsVM.appointmentFilterProviderSearchHistory.isNotEmpty) ...[ if (appointmentsVM.appointmentFilterProviderSearchHistory.isNotEmpty) ...[
const Divider(thickness: 1.2).paddingOnly(top: 5, bottom: 5), const Divider(thickness: 1.2).paddingOnly(top: 5, bottom: 5),
SearchEntityWidget( SearchEntityWidget(
title: "Search By Branch", title: LocaleKeys.searchByBranch.tr(),
actionWidget: Builder( actionWidget: Builder(
builder: (context) { builder: (context) {
return DropdownField( return DropdownField(
@ -112,7 +113,7 @@ class _AppointmentsFilterViewState extends State<AppointmentsFilterView> {
dropdownValue: appointmentsVM.appointmentFilterSelectedBranchId.selectedId != -1 dropdownValue: appointmentsVM.appointmentFilterSelectedBranchId.selectedId != -1
? DropValue(appointmentsVM.appointmentFilterSelectedBranchId.selectedId, appointmentsVM.appointmentFilterSelectedBranchId.selectedOption, "") ? DropValue(appointmentsVM.appointmentFilterSelectedBranchId.selectedId, appointmentsVM.appointmentFilterSelectedBranchId.selectedOption, "")
: null, : null,
hint: "Select Branch", hint: LocaleKeys.selectBranch.tr(),
); );
}, },
), ),
@ -126,7 +127,7 @@ class _AppointmentsFilterViewState extends State<AppointmentsFilterView> {
], ],
const Divider(thickness: 1.2).paddingOnly(top: 5, bottom: 5), const Divider(thickness: 1.2).paddingOnly(top: 5, bottom: 5),
SearchEntityWidget( SearchEntityWidget(
title: "Search By Category", title: LocaleKeys.searchByCategory.tr(),
actionWidget: Builder( actionWidget: Builder(
builder: (context) { builder: (context) {
return DropdownField( return DropdownField(
@ -135,7 +136,7 @@ class _AppointmentsFilterViewState extends State<AppointmentsFilterView> {
dropdownValue: appointmentsVM.appointmentFilterSelectedCategoryId.selectedId != -1 dropdownValue: appointmentsVM.appointmentFilterSelectedCategoryId.selectedId != -1
? DropValue(appointmentsVM.appointmentFilterSelectedCategoryId.selectedId, appointmentsVM.appointmentFilterSelectedCategoryId.selectedOption, "") ? DropValue(appointmentsVM.appointmentFilterSelectedCategoryId.selectedId, appointmentsVM.appointmentFilterSelectedCategoryId.selectedOption, "")
: null, : null,
hint: "Select Category", hint: LocaleKeys.selectCategory.tr(),
); );
}, },
), ),
@ -148,7 +149,7 @@ class _AppointmentsFilterViewState extends State<AppointmentsFilterView> {
), ),
const Divider(thickness: 1.2).paddingOnly(top: 5, bottom: 5), const Divider(thickness: 1.2).paddingOnly(top: 5, bottom: 5),
SearchEntityWidget( SearchEntityWidget(
title: "Search By Service", title: LocaleKeys.searchByService.tr(),
actionWidget: Builder(builder: (context) { actionWidget: Builder(builder: (context) {
return DropdownField( return DropdownField(
(DropValue value) => appointmentsVM.updateAppointmentFilterSelectedServiceId(SelectionModel(selectedId: value.id, selectedOption: value.value), isForSearch: true), (DropValue value) => appointmentsVM.updateAppointmentFilterSelectedServiceId(SelectionModel(selectedId: value.id, selectedOption: value.value), isForSearch: true),
@ -156,7 +157,7 @@ class _AppointmentsFilterViewState extends State<AppointmentsFilterView> {
dropdownValue: appointmentsVM.appointmentFilterSelectedServiceId.selectedId != -1 dropdownValue: appointmentsVM.appointmentFilterSelectedServiceId.selectedId != -1
? DropValue(appointmentsVM.appointmentFilterSelectedServiceId.selectedId, appointmentsVM.appointmentFilterSelectedServiceId.selectedOption, "") ? DropValue(appointmentsVM.appointmentFilterSelectedServiceId.selectedId, appointmentsVM.appointmentFilterSelectedServiceId.selectedOption, "")
: null, : null,
hint: "Select Services", hint: LocaleKeys.selectServices.tr(),
); );
}), }),
historyContent: appointmentsVM.appointmentFilterServicesSearchHistory, historyContent: appointmentsVM.appointmentFilterServicesSearchHistory,
@ -175,7 +176,7 @@ class _AppointmentsFilterViewState extends State<AppointmentsFilterView> {
Expanded( Expanded(
child: ShowFillButton( child: ShowFillButton(
maxHeight: 55, maxHeight: 55,
title: "Search", title: LocaleKeys.search.tr(),
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
appointmentsVM.getAppointmentsBasedOnFilters(); appointmentsVM.getAppointmentsBasedOnFilters();
@ -190,7 +191,7 @@ class _AppointmentsFilterViewState extends State<AppointmentsFilterView> {
8.height, 8.height,
InkWell( InkWell(
onTap: () => appointmentsVM.clearAppointmentFilters(), onTap: () => appointmentsVM.clearAppointmentFilters(),
child: "Clear Filters".toText( child: LocaleKeys.clearFilters.tr().toText(
fontSize: 14, fontSize: 14,
isBold: true, isBold: true,
color: MyColors.darkPrimaryColor, color: MyColors.darkPrimaryColor,

@ -45,15 +45,15 @@ class _LoginWithPasswordState extends State<LoginWithPassword> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
scheduleMicrotask(() {
if (AppState().currentAppType == AppType.provider) { if (AppState().currentAppType == AppType.provider) {
// phoneNum = "966580816976";
// password = "123@Shf";
phoneNum = "966530896018"; phoneNum = "966530896018";
password = "Amir@1234"; password = "Amir@1234";
} }
scheduleMicrotask(() {
userVM = Provider.of(context, listen: false); userVM = Provider.of(context, listen: false);
context.read<UserVM>().getAvailBio(); context.read<UserVM>().getAvailBio();
getCountryList(); getCountryList();
}); });
} }

@ -1,3 +1,5 @@
import 'dart:async';
import 'package:mc_common_app/classes/app_state.dart'; import 'package:mc_common_app/classes/app_state.dart';
import 'package:mc_common_app/classes/consts.dart'; import 'package:mc_common_app/classes/consts.dart';
import 'package:mc_common_app/config/dependencies.dart'; import 'package:mc_common_app/config/dependencies.dart';
@ -8,20 +10,40 @@ import 'package:mc_common_app/generated/locale_keys.g.dart';
import 'package:mc_common_app/utils/enums.dart'; import 'package:mc_common_app/utils/enums.dart';
import 'package:mc_common_app/utils/navigator.dart'; import 'package:mc_common_app/utils/navigator.dart';
import 'package:mc_common_app/utils/utils.dart'; import 'package:mc_common_app/utils/utils.dart';
import 'package:mc_common_app/view_models/user_view_model.dart';
import 'package:mc_common_app/widgets/button/show_fill_button.dart'; import 'package:mc_common_app/widgets/button/show_fill_button.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
import 'package:sizer/sizer.dart'; import 'package:sizer/sizer.dart';
import '../../theme/colors.dart'; import '../../theme/colors.dart';
class RegisterSelectionPage extends StatelessWidget { class RegisterSelectionPage extends StatefulWidget {
const RegisterSelectionPage({Key? key}) : super(key: key); const RegisterSelectionPage({Key? key}) : super(key: key);
@override
State<RegisterSelectionPage> createState() => _RegisterSelectionPageState();
}
class _RegisterSelectionPageState extends State<RegisterSelectionPage> {
AppState appState = AppState();
late UserVM userVM;
@override
void initState() {
super.initState();
appState = injector.get<AppState>();
scheduleMicrotask(() {
if (AppState().currentAppType == AppType.provider) {
context.read<UserVM>().isAlreadyUserLoggedin(context);
}
});
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AppState appState = injector.get<AppState>();
return Scaffold( return Scaffold(
body: Container( body: Container(
width: double.infinity, width: double.infinity,

Loading…
Cancel
Save