Localization

localization_aamir
Aamir.Muhammad 3 months ago
parent fcd5436fb7
commit 4abcd4efe3

@ -351,5 +351,94 @@
"demandAmount": "المبلغ المطلوب",
"warrantyAvailableYears": "الضمان متاح (عدد السنوات)",
"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": "الضريبة"
}

@ -351,6 +351,96 @@
"demandAmount": "Demand Amount",
"warrantyAvailableYears": "Warranty Available (No. of Years)",
"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"
}

@ -367,7 +367,94 @@ class CodegenLoader extends AssetLoader{
"demandAmount": "المبلغ المطلوب",
"warrantyAvailableYears": "الضمان متاح (عدد السنوات)",
"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": "الضريبة"
};
static const Map<String,dynamic> en_US = {
"firstTimeLogIn": "First Time Log In",
@ -722,7 +809,95 @@ static const Map<String,dynamic> en_US = {
"demandAmount": "Demand Amount",
"warrantyAvailableYears": "Warranty Available (No. of Years)",
"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"
};
static const Map<String, Map<String,dynamic>> mapLocales = {"ar_SA": ar_SA, "en_US": en_US};
}

@ -332,5 +332,91 @@ abstract class LocaleKeys {
static const warrantyAvailableYears = 'warrantyAvailableYears';
static const vehicleDescription = 'vehicleDescription';
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';
}

@ -6,7 +6,9 @@ import 'package:huawei_fido/huawei_fido.dart';
import 'package:local_auth/local_auth.dart';
import 'package:local_auth_android/local_auth_android.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:easy_localization/easy_localization.dart';
abstract class CommonAuthServices {
Future<bool> authenticate();
@ -33,17 +35,17 @@ class CommonAuthImp implements CommonAuthServices {
useErrorDialogs: true,
),
authMessages: [
const AndroidAuthMessages(
cancelButton: 'Cancel',
biometricHint: 'Please use your fingerprint or face ID',
goToSettingsButton: 'Settings',
goToSettingsDescription: 'Please set up your Touch ID.',
AndroidAuthMessages(
cancelButton: LocaleKeys.cancel.tr(),
biometricHint: LocaleKeys.useFingerPrintFaceID.tr(),
goToSettingsButton: LocaleKeys.settings.tr(),
goToSettingsDescription: LocaleKeys.setupTouchID.tr(),
),
const IOSAuthMessages(
cancelButton: 'Cancel',
goToSettingsButton: 'Settings',
goToSettingsDescription: 'Please set up your Touch ID.',
lockOut: 'Please reenable your Touch ID',
IOSAuthMessages(
cancelButton: LocaleKeys.cancel.tr(),
goToSettingsButton: LocaleKeys.settings.tr(),
goToSettingsDescription: LocaleKeys.setupTouchID.tr(),
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/consts.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/models/chat_models/chat_message_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:provider/provider.dart';
import 'package:signalr_core/signalr_core.dart';
import 'package:easy_localization/easy_localization.dart';
class ChatVM extends ChangeNotifier {
final ChatRepo chatRepo;
@ -48,22 +50,22 @@ class ChatVM extends ChangeNotifier {
OfferRequestCommentModel(
index: 0,
isSelected: false,
title: "I have changed my mind.",
title: LocaleKeys.changedMind.tr(),
),
OfferRequestCommentModel(
index: 1,
isSelected: false,
title: "Very High Price.",
title: LocaleKeys.veryHighPrice.tr(),
),
OfferRequestCommentModel(
index: 2,
isSelected: false,
title: "Already Sold",
title: LocaleKeys.alreadySold.tr(),
),
OfferRequestCommentModel(
index: 3,
isSelected: true,
title: "Other",
title: LocaleKeys.otherVar.tr(),
),
];
@ -100,11 +102,15 @@ class ChatVM extends ChangeNotifier {
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()}");
if (AppState().currentAppType == AppType.customer) {
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) {
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
int providerIndex = -1;
if (isMyOwnOffer) {
providerIndex = context.read<RequestsVM>().myFilteredRequests.indexWhere(
providerIndex =
context.read<RequestsVM>().myFilteredRequests.indexWhere(
(element) => element.customerUserID == msg.receiverUserID,
);
} else {
providerIndex = context.read<RequestsVM>().myFilteredRequests.indexWhere(
providerIndex =
context.read<RequestsVM>().myFilteredRequests.indexWhere(
(element) => element.customerUserID == msg.senderUserID,
);
}
@ -126,7 +134,9 @@ class ChatVM extends ChangeNotifier {
// log("here is it: ${msg.senderUserID}");
// log("here is it: ${context.read<RequestsVM>().myFilteredRequests.first.customerUserID.toString()}");
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 {
if (hubConnection == null || hubConnection!.state != HubConnectionState.connected) {
if (hubConnection == null ||
hubConnection!.state != HubConnectionState.connected) {
try {
hubConnection = await chatRepo.getHubConnection();
await hubConnection!.start();
hubConnection!.on("ReceiveMessageRequestOffer", (List<Object?>? arguments) {
hubConnection!.on("ReceiveMessageRequestOffer",
(List<Object?>? arguments) {
if (arguments == null || arguments.isEmpty) return;
List<ChatMessageModel> chat = [];
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);
}
onNewMessageReceived(messages: chat, context: context);
@ -165,7 +178,8 @@ class ChatVM extends ChangeNotifier {
required String offerPrice,
required BuildContext context,
}) async {
if (hubConnection == null || hubConnection!.state != HubConnectionState.connected) {
if (hubConnection == null ||
hubConnection!.state != HubConnectionState.connected) {
await buildHubConnection(context);
}
if (hubConnection!.state == HubConnectionState.connected) {
@ -183,7 +197,8 @@ class ChatVM extends ChangeNotifier {
"RequestID": requestId,
"Price": double.parse(offerPrice),
"ServiceProviderID": providerId,
"OfferStatus": RequestOfferStatusEnum.offer.getIdFromRequestOfferStatusEnum(),
"OfferStatus": RequestOfferStatusEnum.offer
.getIdFromRequestOfferStatusEnum(),
"Comment": message,
},
}
@ -207,7 +222,8 @@ class ChatVM extends ChangeNotifier {
}) async {
if (message.isEmpty) return false;
if (hubConnection == null || hubConnection!.state != HubConnectionState.connected) {
if (hubConnection == null ||
hubConnection!.state != HubConnectionState.connected) {
await buildHubConnection(context);
}
if (hubConnection!.state == HubConnectionState.connected) {
@ -251,14 +267,21 @@ class ChatVM extends ChangeNotifier {
);
if (AppState().currentAppType == AppType.customer) {
int providerIndex = serviceProviderOffersList.indexWhere((element) => element.providerUserId == receiverId);
int providerIndex = serviceProviderOffersList
.indexWhere((element) => element.providerUserId == receiverId);
if (providerIndex != -1) {
serviceProviderOffersList[providerIndex].chatMessages!.add(chatMessageModel);
serviceProviderOffersList[providerIndex]
.chatMessages!
.add(chatMessageModel);
}
} 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) {
context.read<RequestsVM>().addChatMessagesInRequestsModel(msg: chatMessageModel, index: providerIndex);
context.read<RequestsVM>().addChatMessagesInRequestsModel(
msg: chatMessageModel, index: providerIndex);
}
}
return true;
@ -268,10 +291,12 @@ class ChatVM extends ChangeNotifier {
List<ServiceProvidersOffers> serviceProviderOffersList = [];
Future<void> getOffersFromProvidersByRequest({required int requestId, required BuildContext context}) async {
Future<void> getOffersFromProvidersByRequest(
{required int requestId, required BuildContext context}) async {
try {
Utils.showLoading(context);
ProviderOffersModel providerOffersModel = await requestRepo.getOffersFromProvidersByRequest(requestId: requestId);
ProviderOffersModel providerOffersModel = await requestRepo
.getOffersFromProvidersByRequest(requestId: requestId);
Utils.hideLoading(context);
serviceProviderOffersList.clear();
serviceProviderOffersList = providerOffersModel.serviceProviders ?? [];
@ -293,10 +318,15 @@ class ChatVM extends ChangeNotifier {
try {
int customerId = AppState().getUser.data!.userInfo!.customerId!;
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;
if (serviceProviderOffersList[providerOfferIndex].chatMessages != null) {
for (var message in serviceProviderOffersList[providerOfferIndex].chatMessages!) {
for (var message
in serviceProviderOffersList[providerOfferIndex].chatMessages!) {
if (message.chatMessageTypeEnum == ChatMessageTypeEnum.offer) {
updateLatestOfferId(message.reqOfferID ?? 0);
log("latestOfferId: $latestOfferId");
@ -322,8 +352,13 @@ class ChatVM extends ChangeNotifier {
try {
int providerId = AppState().getUser.data!.userInfo!.providerId!;
Utils.showLoading(context);
List<ChatMessageModel> chatMessages = await chatRepo.getUsersChatMessages(providerId: providerId, customerId: customerId, requestOfferId: requestOfferId, requestId: requestId);
context.read<RequestsVM>().overwriteChatMessagesInRequestsModel(messages: chatMessages, index: customerRequestIndex);
List<ChatMessageModel> chatMessages = await chatRepo.getUsersChatMessages(
providerId: providerId,
customerId: customerId,
requestOfferId: requestOfferId,
requestId: requestId);
context.read<RequestsVM>().overwriteChatMessagesInRequestsModel(
messages: chatMessages, index: customerRequestIndex);
Utils.hideLoading(context);
} catch (e) {
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 {
Utils.showLoading(context);
GenericRespModel genericRespModel = await requestRepo.updateOfferRequestStatus(requestOfferStatusEnum: requestOfferStatusEnum, requestOfferId: reqOfferId);
GenericRespModel genericRespModel =
await requestRepo.updateOfferRequestStatus(
requestOfferStatusEnum: requestOfferStatusEnum,
requestOfferId: reqOfferId);
Utils.hideLoading(context);
return genericRespModel.messageStatus == 1 ? reqOfferId : -1;
} catch (e) {

@ -3,6 +3,7 @@ import 'dart:developer';
import 'package:flutter/cupertino.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/models/payment_models/pay_order_detail_resp_model.dart';
import 'package:mc_common_app/repositories/payments_repo.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/view_models/subscriptions_view_model.dart';
import 'package:provider/provider.dart';
import 'package:easy_localization/easy_localization.dart';
import '../classes/app_state.dart';
class PaymentVM extends ChangeNotifier {
@ -52,9 +53,8 @@ class PaymentVM extends ChangeNotifier {
notifyListeners();
}
Future<void> onContinuePressed(BuildContext context, {required PaymentTypes paymentType}) async {
Future<void> onContinuePressed(BuildContext context,
{required PaymentTypes paymentType}) async {
switch (selectedPaymentMethod) {
case PaymentMethods.mada:
// TODO: Handle this case.
@ -76,41 +76,53 @@ class PaymentVM extends ChangeNotifier {
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);
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));
Utils.hideLoading(context);
log("payOrderDetailRespModel: ${payOrderDetailRespModel.toString()}");
if (payOrderDetailRespModel.isPaid == null || !payOrderDetailRespModel.isPaid!) {
Utils.showToast("Payment Failed!");
if (payOrderDetailRespModel.isPaid == null ||
!payOrderDetailRespModel.isPaid!) {
Utils.showToast(LocaleKeys.paymentFailed.tr());
return;
}
if (payOrderDetailRespModel.isPaid != null && payOrderDetailRespModel.isPaid!) {
Utils.showToast("Payment Successful");
if (payOrderDetailRespModel.isPaid != null &&
payOrderDetailRespModel.isPaid!) {
Utils.showToast(LocaleKeys.paymentSuccessful.tr());
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);
//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));
Utils.hideLoading(context);
log("payOrderDetailRespModel: ${payOrderDetailRespModel.toString()}");
if (payOrderDetailRespModel.isPaid == null || !payOrderDetailRespModel.isPaid!) {
Utils.showToast("Payment Failed!");
if (payOrderDetailRespModel.isPaid == null ||
!payOrderDetailRespModel.isPaid!) {
Utils.showToast(LocaleKeys.paymentFailed.tr());
return;
}
if (payOrderDetailRespModel.isPaid != null && payOrderDetailRespModel.isPaid!) {
Utils.showToast("Payment Successful");
if (payOrderDetailRespModel.isPaid != null &&
payOrderDetailRespModel.isPaid!) {
Utils.showToast(LocaleKeys.paymentSuccessful.tr());
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(
// This will be request ID for request payment || ad ID for Ad Related Payment || OrderProviderSubscriptionID for SubscriptionPayment
id: getIdTypeByPaymentType(paymentTypeEnum),
appointmentIds: appointmentIdsForPayment,
paymentType: paymentTypeEnum,
onFailure: () {
Utils.showToast("Payment Failed!");
Utils.showToast(LocaleKeys.paymentFailed.tr());
switch (paymentTypeEnum) {
case PaymentTypes.subscription:
// TODO: Handle this case.
@ -179,7 +193,10 @@ class PaymentVM extends ChangeNotifier {
case PaymentTypes.adReserve:
case PaymentTypes.ads:
case PaymentTypes.extendAds:
await onAdsPaymentSuccess(context: context, paymentTypeId: paymentTypeEnum.getIdFromPaymentTypesEnum(), currentAdId: currentAdId);
await onAdsPaymentSuccess(
context: context,
paymentTypeId: paymentTypeEnum.getIdFromPaymentTypesEnum(),
currentAdId: currentAdId);
break;
case PaymentTypes.partialAppointment:
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);
context.read<SubscriptionsVM>().getMySubscriptions(
AppState()
.getUser
.data
?.userInfo
?.providerId
.toString() ??
"");
AppState().getUser.data?.userInfo?.providerId.toString() ?? "");
}
Future<void> onVisaCardSelected(BuildContext context, PaymentTypes paymentType) async {
Future<void> onVisaCardSelected(
BuildContext context, PaymentTypes paymentType) async {
currentPaymentType = paymentType;
switch (currentPaymentType) {
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/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/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/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/chat_view_model.dart';
import 'package:provider/provider.dart';
import 'package:easy_localization/easy_localization.dart';
class RequestsVM extends BaseVM {
final CommonAppServices commonServices;
final CommonRepo commonRepo;
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> myFilteredRequests = [];
@ -44,10 +49,14 @@ class RequestsVM extends BaseVM {
if (requestsTypeFilterOptions.isNotEmpty) return;
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++) {
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()}");
@ -55,7 +64,8 @@ class RequestsVM extends BaseVM {
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);
var paramsForGetRequests = <String, dynamic>{};
@ -66,22 +76,29 @@ class RequestsVM extends BaseVM {
"requestType": 0,
};
if (appType == AppType.provider) {
paramsForGetRequests.addEntries([MapEntry("providerID", AppState().getUser.data!.userInfo!.providerId)]);
paramsForGetRequests.addEntries([
MapEntry("providerID", AppState().getUser.data!.userInfo!.providerId)
]);
} else {
paramsForGetRequests.addEntries([MapEntry("customerID", AppState().getUser.data!.userInfo!.customerId)]);
paramsForGetRequests.addEntries([
MapEntry("customerID", AppState().getUser.data!.userInfo!.customerId)
]);
}
myRequests = await requestRepo.getRequests(paramsForGetRequests);
applyFilterOnRequestsVM(requestsTypeEnum: RequestsTypeEnum.specialCarRequest);
applyFilterOnRequestsVM(
requestsTypeEnum: RequestsTypeEnum.specialCarRequest);
setState(ViewState.idle);
notifyListeners();
}
addChatMessagesInRequestsModel({required ChatMessageModel msg, required int index}) {
addChatMessagesInRequestsModel(
{required ChatMessageModel msg, required int index}) {
myFilteredRequests[index].chatMessages.add(msg);
notifyListeners();
}
overwriteChatMessagesInRequestsModel({required List<ChatMessageModel> messages, required int index}) {
overwriteChatMessagesInRequestsModel(
{required List<ChatMessageModel> messages, required int index}) {
myFilteredRequests[index].chatMessages.clear();
myFilteredRequests[index].chatMessages = messages;
notifyListeners();
@ -92,8 +109,14 @@ class RequestsVM extends BaseVM {
for (var value in requestsTypeFilterOptions) {
value.isSelected = false;
}
requestsTypeFilterOptions[requestsTypeEnum.getIdFromRequestTypeStatusEnum() - 1].isSelected = true; // -1 to match with the index
myFilteredRequests = myRequests.where((element) => element.requestType == requestsTypeEnum.getIdFromRequestTypeStatusEnum()).toList();
requestsTypeFilterOptions[
requestsTypeEnum.getIdFromRequestTypeStatusEnum() - 1]
.isSelected = true; // -1 to match with the index
myFilteredRequests = myRequests
.where((element) =>
element.requestType ==
requestsTypeEnum.getIdFromRequestTypeStatusEnum())
.toList();
notifyListeners();
}
@ -102,7 +125,8 @@ class RequestsVM extends BaseVM {
String vehicleImageError = "";
void removeImageFromList(String filePath) {
int index = pickedVehicleImages.indexWhere((element) => element.filePath == filePath);
int index = pickedVehicleImages
.indexWhere((element) => element.filePath == filePath);
if (index == -1) {
return;
}
@ -132,7 +156,8 @@ class RequestsVM extends BaseVM {
List<VehicleCountryModel> vehicleCountries = [];
List<VehicleCityModel> vehicleCities = [];
SelectionModel requestTypeId = SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
SelectionModel requestTypeId =
SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
void updateSelectionRequestTypeId(SelectionModel id) async {
requestTypeId = id;
@ -140,7 +165,8 @@ class RequestsVM extends BaseVM {
notifyListeners();
}
SelectionModel vehicleTypeId = SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
SelectionModel vehicleTypeId =
SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
Future<void> getVehicleTypes() async {
resetRequestCreationForm();
@ -171,7 +197,8 @@ class RequestsVM extends BaseVM {
// }
isFetchingVehicleDetail = true;
notifyListeners();
vehicleDetails = await commonRepo.getVehicleDetails(vehicleTypeId: vehicleTypeId.selectedId);
vehicleDetails = await commonRepo.getVehicleDetails(
vehicleTypeId: vehicleTypeId.selectedId);
if (vehicleDetails != null) {
vehicleBrands = vehicleDetails!.vehicleBrands!;
@ -183,24 +210,30 @@ class RequestsVM extends BaseVM {
notifyListeners();
}
SelectionModel vehicleBrandId = SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
SelectionModel vehicleBrandId =
SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
void updateSelectionVehicleBrandId(SelectionModel id) {
vehicleBrandId = id;
vehicleModelId = SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
vehicleModelYearId = SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
vehicleModelId =
SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
vehicleModelYearId =
SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
notifyListeners();
}
SelectionModel vehicleModelId = SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
SelectionModel vehicleModelId =
SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
void updateSelectionVehicleModelId(SelectionModel id) {
vehicleModelId = id;
vehicleModelYearId = SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
vehicleModelYearId =
SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
notifyListeners();
}
SelectionModel vehicleModelYearId = SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
SelectionModel vehicleModelYearId =
SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
void updateSelectionVehicleModelYearId(SelectionModel id) {
vehicleModelYearId = id;
@ -215,18 +248,21 @@ class RequestsVM extends BaseVM {
}
bool isCountryFetching = false;
SelectionModel vehicleCountryId = SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
SelectionModel vehicleCountryId =
SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
void updateSelectionVehicleCountryId(SelectionModel id) async {
vehicleCountryId = id;
isCountryFetching = true;
notifyListeners();
vehicleCities = await commonRepo.getVehicleCities(countryId: vehicleCountryId.selectedId);
vehicleCities = await commonRepo.getVehicleCities(
countryId: vehicleCountryId.selectedId);
isCountryFetching = false;
notifyListeners();
}
SelectionModel vehicleCityId = SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
SelectionModel vehicleCityId =
SelectionModel(selectedOption: "", selectedId: -1, errorValue: "");
void updateSelectionVehicleCityId(SelectionModel id) {
vehicleCityId = id;
@ -244,10 +280,12 @@ class RequestsVM extends BaseVM {
description = v;
}
Future<RequestPostingImages> convertFileToRequestPostingImages({required File file}) async {
Future<RequestPostingImages> convertFileToRequestPostingImages(
{required File file}) async {
List<int> imageBytes = await file.readAsBytes();
String image = base64Encode(imageBytes);
RequestPostingImages vehiclePostingImages = RequestPostingImages(requestImage: image);
RequestPostingImages vehiclePostingImages =
RequestPostingImages(requestImage: image);
return vehiclePostingImages;
}
@ -256,7 +294,8 @@ class RequestsVM extends BaseVM {
log("requestImages: ${pickedVehicleImages.length}");
for (var image in pickedVehicleImages) {
var value = await convertFileToRequestPostingImages(file: File(image.filePath!));
var value =
await convertFileToRequestPostingImages(file: File(image.filePath!));
requestImages.add(value);
}
@ -267,7 +306,8 @@ class RequestsVM extends BaseVM {
if (validateCreateRequestForm()) {
Utils.showLoading(context);
List<RequestPostingImages> vehicleImages = await getVehiclePostingImageList();
List<RequestPostingImages> vehicleImages =
await getVehiclePostingImageList();
List requestImages = [];
vehicleImages.forEach((element) {
requestImages.add(element.toJson());
@ -291,7 +331,7 @@ class RequestsVM extends BaseVM {
GenericRespModel respModel = await requestRepo.createRequest(body);
Utils.hideLoading(context);
if (respModel.messageStatus == 1) {
Utils.showToast("Request Successfully Created");
Utils.showToast(LocaleKeys.requestSuccessfullyCreated.tr());
Navigator.pop(context);
await getRequests(appType: AppType.customer);
} else {
@ -307,40 +347,42 @@ class RequestsVM extends BaseVM {
bool validateCreateRequestForm() {
bool isValid = true;
if (requestTypeId.selectedId == -1) {
Utils.showToast("Please select valid Request Type");
Utils.showToast(LocaleKeys.selectValidRequestType.tr());
isValid = false;
} else if (vehicleTypeId.selectedId == -1) {
Utils.showToast("Please select valid Vehicle Type");
Utils.showToast(LocaleKeys.vehicle_selectValidVehicleType.tr());
isValid = false;
} else if (vehicleBrandId.selectedId == -1) {
Utils.showToast("Please select valid Brand");
Utils.showToast(LocaleKeys.selectValidBrand.tr());
isValid = false;
} else if (vehicleModelId.selectedId == -1) {
Utils.showToast("Please select valid Model");
Utils.showToast(LocaleKeys.selectValidModel.tr());
isValid = false;
} else if (vehicleModelYearId.selectedId == -1) {
Utils.showToast("Please select valid Year");
Utils.showToast(LocaleKeys.selectValidYear.tr());
isValid = false;
} else if (vehicleCountryId.selectedId == -1) {
Utils.showToast("Please select valid Country");
Utils.showToast(LocaleKeys.selectValidCountry.tr());
isValid = false;
} else if (vehicleCityId.selectedId == -1) {
Utils.showToast("Please select valid City");
Utils.showToast(LocaleKeys.selectValidCity.tr());
isValid = false;
} else if (price.isEmpty) {
Utils.showToast("Please add valid Price");
Utils.showToast(LocaleKeys.addValidPrice.tr());
isValid = false;
} else if (description.isEmpty) {
Utils.showToast("Please add valid Description");
Utils.showToast(LocaleKeys.addValidDescription.tr());
isValid = false;
}
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 {
Utils.showLoading(context);
List<OffersModel> respModel = await requestRepo.getOffersByRequest(requestId: requestId);
List<OffersModel> respModel =
await requestRepo.getOffersByRequest(requestId: requestId);
Utils.hideLoading(context);
return respModel;
} catch (e) {
@ -431,22 +473,26 @@ class RequestsVM extends BaseVM {
ChatMessageModel chatMessageModel = ChatMessageModel(
isMyMessage: true,
chatText: message,
messageType: ChatMessageTypeEnum.offer.getIdFromChatMessageTypeEnum(),
messageType:
ChatMessageTypeEnum.offer.getIdFromChatMessageTypeEnum(),
senderName: senderName,
senderUserID: senderId,
receiverUserID: receiverId,
chatMessageTypeEnum: ChatMessageTypeEnum.offer,
requestID: requestModel.id,
offerStatus: RequestOfferStatusEnum.offer.getIdFromRequestOfferStatusEnum(),
offerStatus:
RequestOfferStatusEnum.offer.getIdFromRequestOfferStatusEnum(),
reqOffer: ReqOffer(
offerStatus: RequestOfferStatusEnum.offer.getIdFromRequestOfferStatusEnum(),
offerStatus: RequestOfferStatusEnum.offer
.getIdFromRequestOfferStatusEnum(),
requestID: requestModel.id,
price: double.parse(offerPrice),
requestOfferStatusEnum: RequestOfferStatusEnum.offer,
comment: message,
offerStatusText: "",
));
context.read<ChatVM>().onNewMessageReceived(messages: [chatMessageModel], context: context, isMyOwnOffer: true);
context.read<ChatVM>().onNewMessageReceived(
messages: [chatMessageModel], context: context, isMyOwnOffer: true);
if (!isFromChatScreen) {
ChatViewArguments chatViewArguments = ChatViewArguments(
chatTypeEnum: ChatTypeEnum.requestOffer,
@ -456,7 +502,8 @@ class RequestsVM extends BaseVM {
requestIndex: requestIndex,
providerIndex: -1,
);
navigateWithName(context, AppRoutes.chatView, arguments: chatViewArguments);
navigateWithName(context, AppRoutes.chatView,
arguments: chatViewArguments);
}
}
}

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

@ -1,6 +1,5 @@
import 'dart:convert';
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/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/view_models/base_view_model.dart';
import 'package:mc_common_app/widgets/dropdown/dropdow_field.dart';
import '../repositories/subscription_repo.dart';
class SubscriptionsVM extends BaseVM {
@ -171,7 +169,8 @@ class SubscriptionsVM extends BaseVM {
selectedIndex = 0;
setState(ViewState.busy);
// allSubscriptions = await subscriptionRepo.getAllSubscriptions(serviceProviderID);
allSubscriptions = await subscriptionRepo.getMySubscriptions(serviceProviderID);
allSubscriptions =
await subscriptionRepo.getMySubscriptions(serviceProviderID);
if (allSubscriptions.messageStatus == 1) {
// allSubscriptions.data!.sort((a, b) => a.value.compareTo(b.value));
setState(ViewState.idle);

@ -70,16 +70,19 @@ class UserVM extends BaseVM {
notifyListeners();
}
Future<void> changeUserEmail(BuildContext context, String email, String password) async {
Future<void> changeUserEmail(
BuildContext context, String email, String password) async {
Utils.showLoading(context);
ChanEmailRespModel otpRequest = await userRepo.changeEmailOTPRequest(email, password);
ChanEmailRespModel otpRequest =
await userRepo.changeEmailOTPRequest(email, password);
Utils.hideLoading(context);
if (otpRequest.messageStatus == 1) {
showMDialog(context, child: OtpDialog(
onClick: (String code) async {
pop(context);
Utils.showLoading(context);
ConfirmEmailRespModel otpCompare = await userRepo.changeEmail(otpRequest.data!.userToken ?? "", code);
ConfirmEmailRespModel otpCompare = await userRepo.changeEmail(
otpRequest.data!.userToken ?? "", code);
Utils.hideLoading(context);
if (otpCompare.messageStatus == 1) {
showMDialog(
@ -88,7 +91,9 @@ class UserVM extends BaseVM {
title: LocaleKeys.emailChangedSuccessfully.tr(),
//"Email is Changed Successfully",
onClick: () {
Navigator.of(context).pushNamedAndRemoveUntil(AppRoutes.loginWithPassword, (Route<dynamic> route) => true);
Navigator.of(context).pushNamedAndRemoveUntil(
AppRoutes.loginWithPassword,
(Route<dynamic> route) => true);
},
),
);
@ -102,16 +107,19 @@ class UserVM extends BaseVM {
}
}
Future<void> changeUserMobile(BuildContext context, int countryId, String mobileNo, String password) async {
Future<void> changeUserMobile(BuildContext context, int countryId,
String mobileNo, String password) async {
Utils.showLoading(context);
ChangeMobileRespModel otpRequest = await userRepo.changeMobileNoOTPRequest(countryId, mobileNo, password);
ChangeMobileRespModel otpRequest =
await userRepo.changeMobileNoOTPRequest(countryId, mobileNo, password);
Utils.hideLoading(context);
if (otpRequest.messageStatus == 1) {
showMDialog(context, child: OtpDialog(
onClick: (String code) async {
pop(context);
Utils.showLoading(context);
ConfirmMobileRespModel otpCompare = await userRepo.changeMobileNo(otpRequest.data!.userToken ?? "", code);
ConfirmMobileRespModel otpCompare = await userRepo.changeMobileNo(
otpRequest.data!.userToken ?? "", code);
Utils.hideLoading(context);
if (otpCompare.messageStatus == 1) {
showMDialog(
@ -120,7 +128,9 @@ class UserVM extends BaseVM {
title: LocaleKeys.phoneNumberVerified.tr(),
//"Phone Number Verified",
onClick: () {
Navigator.of(context).pushNamedAndRemoveUntil(AppRoutes.loginWithPassword, (Route<dynamic> route) => true);
Navigator.of(context).pushNamedAndRemoveUntil(
AppRoutes.loginWithPassword,
(Route<dynamic> route) => true);
},
),
);
@ -134,16 +144,19 @@ class UserVM extends BaseVM {
}
}
Future<void> changeUserPassword(BuildContext context, String newPassword, String currentPassword) async {
Future<void> changeUserPassword(
BuildContext context, String newPassword, String currentPassword) async {
if (Utils.passwordValidateStructure(newPassword)) {
Utils.showLoading(context);
MResponse res = await userRepo.changePassword(currentPassword, newPassword);
MResponse res =
await userRepo.changePassword(currentPassword, newPassword);
Utils.hideLoading(context);
if (res.messageStatus == 1) {
Utils.showToast(LocaleKeys.passwordIsUpdated.tr());
//("Password is Updated");
// navigateWithName(context, AppRoutes.loginWithPassword);
Navigator.of(context).pushNamedAndRemoveUntil(AppRoutes.loginWithPassword, (Route<dynamic> route) => true);
Navigator.of(context).pushNamedAndRemoveUntil(
AppRoutes.loginWithPassword, (Route<dynamic> route) => true);
} else {
Utils.showToast(res.message ?? "");
}
@ -226,26 +239,28 @@ class UserVM extends BaseVM {
void checkPassword(String password) {
if (password.length <= 6) {
updateStrengthThreshold(1 / 4);
updateStrengthText('Your password is too short');
updateStrengthText(LocaleKeys.passwordTooShort.tr());
} else if (password.length < 8) {
updateStrengthThreshold(2 / 4);
updateStrengthText('Your password is acceptable but not strong');
updateStrengthText(LocaleKeys.passwordAcceptableStrong.tr());
} else {
if (!letterReg.hasMatch(password) || !numReg.hasMatch(password)) {
updateStrengthThreshold(3 / 4);
updateStrengthText('Your password is strong');
updateStrengthText(LocaleKeys.passwordIsStrong.tr());
} else {
updateStrengthThreshold(1);
updateStrengthText('Your password is very strong');
updateStrengthText(LocaleKeys.passwordVeryStrong.tr());
}
}
notifyListeners();
}
Future<void> confirmPasswordOTP(BuildContext context, {required String userToken, required String newPassword}) async {
Future<void> confirmPasswordOTP(BuildContext context,
{required String userToken, required String newPassword}) async {
if (Utils.passwordValidateStructure(newPassword)) {
Utils.showLoading(context);
ConfirmPasswordRespModel data = await userRepo.forgetPassword(userToken, newPassword);
ConfirmPasswordRespModel data =
await userRepo.forgetPassword(userToken, newPassword);
Utils.hideLoading(context);
if (data.messageStatus == 1) {
Utils.showToast(LocaleKeys.passwordIsUpdated.tr());
@ -258,7 +273,8 @@ class UserVM extends BaseVM {
}
}
Future<void> verifyEmail(BuildContext context, {required String email, required String userID}) async {
Future<void> verifyEmail(BuildContext context,
{required String email, required String userID}) async {
Utils.showLoading(context);
VerifyEmailRespModel otpRequest = await userRepo.emailVerify(email, userID);
Utils.hideLoading(context);
@ -267,7 +283,8 @@ class UserVM extends BaseVM {
onClick: (String code) async {
pop(context);
Utils.showLoading(context);
MResponse otpCompare = await userRepo.emailVerifyOTPVerify(otpRequest.data!.userToken ?? "", code);
MResponse otpCompare = await userRepo.emailVerifyOTPVerify(
otpRequest.data!.userToken ?? "", code);
Utils.hideLoading(context);
if (otpCompare.messageStatus == 1) {
AppState().getUser.data!.userInfo!.isEmailVerified = true;
@ -283,16 +300,19 @@ class UserVM extends BaseVM {
notifyListeners();
}
Future<void> forgetPasswordOTPMethod(BuildContext context, {required String userToken}) async {
Future<void> forgetPasswordOTPMethod(BuildContext context,
{required String userToken}) async {
showMDialog(context, child: OtpDialog(
onClick: (String code) async {
pop(context);
Utils.showLoading(context);
PasswordOTPCompareResModel otpCompare = await userRepo.forgetPasswordOTPCompare(userToken, code);
PasswordOTPCompareResModel otpCompare =
await userRepo.forgetPasswordOTPCompare(userToken, code);
Utils.hideLoading(context);
if (otpCompare.messageStatus == 1) {
var userToken = otpCompare.data!.userToken;
navigateWithName(context, AppRoutes.confirmNewPasswordPage, arguments: userToken);
navigateWithName(context, AppRoutes.confirmNewPasswordPage,
arguments: userToken);
} else {
Utils.showToast(otpCompare.message ?? "");
}
@ -300,35 +320,48 @@ class UserVM extends BaseVM {
));
}
Future<void> forgetPasswordPhoneOTP(BuildContext context, {required String countryCode, required String userName, required int otpType}) async {
Future<void> forgetPasswordPhoneOTP(BuildContext context,
{required String countryCode,
required String userName,
required int otpType}) async {
Utils.showLoading(context);
Response response = await userRepo.forgetPasswordOTPRequest(countryCode + userName, otpType);
Response response = await userRepo.forgetPasswordOTPRequest(
countryCode + userName, otpType);
Utils.hideLoading(context);
PasswordOTPRequestRespModel otpRequest = PasswordOTPRequestRespModel.fromJson(jsonDecode(response.body));
PasswordOTPRequestRespModel otpRequest =
PasswordOTPRequestRespModel.fromJson(jsonDecode(response.body));
if (otpRequest.messageStatus == 1) {
var userToken = otpRequest.data!.userToken;
navigateReplaceWithName(context, AppRoutes.forgetPasswordMethodPage, arguments: userToken);
navigateReplaceWithName(context, AppRoutes.forgetPasswordMethodPage,
arguments: userToken);
} else {
Utils.showToast(otpRequest.message ?? "");
}
}
Future<void> forgetPasswordEmailOTP(BuildContext context, {required String countryCode, required String userName, required int otpType}) async {
Future<void> forgetPasswordEmailOTP(BuildContext context,
{required String countryCode,
required String userName,
required int otpType}) async {
Utils.showLoading(context);
Response response = await userRepo.forgetPasswordOTPRequest(userName, otpType);
Response response =
await userRepo.forgetPasswordOTPRequest(userName, otpType);
Utils.hideLoading(context);
PasswordOTPRequestRespModel otpRequest = PasswordOTPRequestRespModel.fromJson(jsonDecode(response.body));
PasswordOTPRequestRespModel otpRequest =
PasswordOTPRequestRespModel.fromJson(jsonDecode(response.body));
if (otpRequest.messageStatus == 1) {
Utils.showToast(LocaleKeys.codeSentToEmail.tr());
showMDialog(context, child: OtpDialog(
onClick: (String code) async {
pop(context);
Utils.showLoading(context);
PasswordOTPCompareResModel otpCompare = await userRepo.forgetPasswordOTPCompare(otpRequest.data!.userToken ?? "", code);
PasswordOTPCompareResModel otpCompare = await userRepo
.forgetPasswordOTPCompare(otpRequest.data!.userToken ?? "", code);
Utils.hideLoading(context);
if (otpCompare.messageStatus == 1) {
var userToken = otpCompare.data!.userToken;
navigateWithName(context, AppRoutes.confirmNewPasswordPage, arguments: userToken);
navigateWithName(context, AppRoutes.confirmNewPasswordPage,
arguments: userToken);
} else {
Utils.showToast(otpCompare.message ?? "");
}
@ -339,28 +372,36 @@ class UserVM extends BaseVM {
}
}
Future<void> performBasicOtpLoginSelectionPage(BuildContext context, {required String userToken, required AppType appType, String? loginType}) async {
Future<void> performBasicOtpLoginSelectionPage(BuildContext context,
{required String userToken,
required AppType appType,
String? loginType}) async {
if (loginType == "3" || loginType == "4") {
Utils.showLoading(context);
LoginPasswordRespModel user = await userRepo.loginV2OTP(userToken, loginType!);
LoginPasswordRespModel user =
await userRepo.loginV2OTP(userToken, loginType!);
Utils.hideLoading(context);
if (user.messageStatus == 1) {
Utils.showLoading(context);
Response response2 = await userRepo.loginV2OTPVerify(user.data!.userToken ?? "", "9999");
Response response2 =
await userRepo.loginV2OTPVerify(user.data!.userToken ?? "", "9999");
Utils.hideLoading(context);
RegisterUserRespModel verifiedUser = RegisterUserRespModel.fromJson(jsonDecode(response2.body));
RegisterUserRespModel verifiedUser =
RegisterUserRespModel.fromJson(jsonDecode(response2.body));
if (verifiedUser.messageStatus == 1) {
User user = User.fromJson(jsonDecode(response2.body));
if (appType == AppType.provider) {
if (user.data!.userInfo!.roleId == 5 || user.data!.userInfo!.roleId == 6) {
if (user.data!.userInfo!.roleId == 5 ||
user.data!.userInfo!.roleId == 6) {
AppState().setUser = user;
SharedPrefManager.setUserToken(user.data!.accessToken ?? "");
SharedPrefManager.setUserId(user.data!.userInfo!.userId ?? "");
SharedPrefManager.setRefreshToken(user.data!.refreshToken ?? "");
SharedPrefManager.setData(jsonEncode(user.data!.userInfo!.toJson()));
SharedPrefManager.setData(
jsonEncode(user.data!.userInfo!.toJson()));
navigateReplaceWithName(context, AppRoutes.dashboard);
} else {
Utils.showToast("LocaleKeys.onlyProviderApp.tr()");
Utils.showToast(LocaleKeys.onlyProviderApp.tr());
//("Sorry, Only Customer's can log in this app");
}
} else if (user.data!.userInfo!.roleId == 4) {
@ -369,10 +410,11 @@ class UserVM extends BaseVM {
SharedPrefManager.setUserToken(user.data!.accessToken ?? "");
SharedPrefManager.setUserId(user.data!.userInfo!.userId ?? "");
SharedPrefManager.setRefreshToken(user.data!.refreshToken ?? "");
SharedPrefManager.setData(jsonEncode(user.data!.userInfo!.toJson()));
SharedPrefManager.setData(
jsonEncode(user.data!.userInfo!.toJson()));
navigateReplaceWithName(context, AppRoutes.dashboard);
} else {
Utils.showToast("Sorry, Only Customer's can log in this app");
Utils.showToast(LocaleKeys.onlyCustomerApp.tr());
}
}
} else {
@ -388,33 +430,42 @@ class UserVM extends BaseVM {
onClick: (String code) async {
pop(context);
Utils.showLoading(context);
Response response2 = await userRepo.loginV2OTPVerify(user.data!.userToken ?? "", code);
Response response2 = await userRepo.loginV2OTPVerify(
user.data!.userToken ?? "", code);
Utils.hideLoading(context);
RegisterUserRespModel verifiedUser = RegisterUserRespModel.fromJson(jsonDecode(response2.body));
RegisterUserRespModel verifiedUser =
RegisterUserRespModel.fromJson(jsonDecode(response2.body));
if (verifiedUser.messageStatus == 1) {
User user = User.fromJson(jsonDecode(response2.body));
if (appType == AppType.provider) {
if (user.data!.userInfo!.roleId == 5 || user.data!.userInfo!.roleId == 6) {
if (user.data!.userInfo!.roleId == 5 ||
user.data!.userInfo!.roleId == 6) {
AppState().setUser = user;
SharedPrefManager.setUserToken(user.data!.accessToken ?? "");
SharedPrefManager.setUserId(user.data!.userInfo!.userId ?? "");
SharedPrefManager.setRefreshToken(user.data!.refreshToken ?? "");
SharedPrefManager.setData(jsonEncode(user.data!.userInfo!.toJson()));
SharedPrefManager.setUserId(
user.data!.userInfo!.userId ?? "");
SharedPrefManager.setRefreshToken(
user.data!.refreshToken ?? "");
SharedPrefManager.setData(
jsonEncode(user.data!.userInfo!.toJson()));
navigateReplaceWithName(context, AppRoutes.dashboard);
} else {
Utils.showToast("LocaleKeys.onlyProviderApp.tr()");
Utils.showToast(LocaleKeys.onlyProviderApp.tr());
//("Sorry, Only Customer's can log in this app");
}
} else if (user.data!.userInfo!.roleId == 4) {
if (user.data!.userInfo!.roleId == 4) {
AppState().setUser = user;
SharedPrefManager.setUserToken(user.data!.accessToken ?? "");
SharedPrefManager.setUserId(user.data!.userInfo!.userId ?? "");
SharedPrefManager.setRefreshToken(user.data!.refreshToken ?? "");
SharedPrefManager.setData(jsonEncode(user.data!.userInfo!.toJson()));
SharedPrefManager.setUserId(
user.data!.userInfo!.userId ?? "");
SharedPrefManager.setRefreshToken(
user.data!.refreshToken ?? "");
SharedPrefManager.setData(
jsonEncode(user.data!.userInfo!.toJson()));
navigateReplaceWithName(context, AppRoutes.dashboard);
} else {
Utils.showToast("Sorry, Only Customer's can log in this app");
Utils.showToast(LocaleKeys.onlyCustomerApp.tr());
}
}
} else {
@ -428,7 +479,8 @@ class UserVM extends BaseVM {
}
}
Future<String> performApiCallLoginVerificationPage(BuildContext context) async {
Future<String> performApiCallLoginVerificationPage(
BuildContext context) async {
String userToken = "";
String userName = await SharedPrefManager.getPhoneOrEmail();
String password = await SharedPrefManager.getUserPassword();
@ -436,7 +488,8 @@ class UserVM extends BaseVM {
Utils.showLoading(context);
Response response = await userRepo.loginV1(userName, password);
Utils.hideLoading(context);
LoginPasswordRespModel user = LoginPasswordRespModel.fromJson(jsonDecode(response.body));
LoginPasswordRespModel user =
LoginPasswordRespModel.fromJson(jsonDecode(response.body));
if (user.messageStatus == 1) {
userToken = user.data!.userToken ?? "";
// navigateWithName(context, AppRoutes.loginMethodSelection, arguments: user.data!.userToken);
@ -447,7 +500,8 @@ class UserVM extends BaseVM {
return userToken;
}
Future<void> performBasicOtpLoginVerificationPage(BuildContext context, {required String userToken}) async {
Future<void> performBasicOtpLoginVerificationPage(BuildContext context,
{required String userToken}) async {
Utils.showLoading(context);
LoginPasswordRespModel user = await userRepo.loginV2OTP(userToken, "1");
Utils.hideLoading(context);
@ -456,9 +510,11 @@ class UserVM extends BaseVM {
onClick: (String code) async {
pop(context);
Utils.showLoading(context);
Response response2 = await userRepo.loginV2OTPVerify(user.data!.userToken ?? "", code);
Response response2 =
await userRepo.loginV2OTPVerify(user.data!.userToken ?? "", code);
Utils.hideLoading(context);
RegisterUserRespModel verifiedUser = RegisterUserRespModel.fromJson(jsonDecode(response2.body));
RegisterUserRespModel verifiedUser =
RegisterUserRespModel.fromJson(jsonDecode(response2.body));
if (verifiedUser.messageStatus == 1) {
User user = User.fromJson(jsonDecode(response2.body));
AppState().setUser = user;
@ -473,16 +529,19 @@ class UserVM extends BaseVM {
}
}
Future<void> performBasicOtpLoginVerifyAccountPage(BuildContext context, {required String phoneNum, required int otpType}) async {
Future<void> performBasicOtpLoginVerifyAccountPage(BuildContext context,
{required String phoneNum, required int otpType}) async {
Utils.showLoading(context);
BasicOtpRespModel basicOtp = await userRepo.basicOtp(phoneNum, otpType: otpType);
BasicOtpRespModel basicOtp =
await userRepo.basicOtp(phoneNum, otpType: otpType);
Utils.hideLoading(context);
if (basicOtp.messageStatus == 1) {
showMDialog(context, child: OtpDialog(
onClick: (String code) async {
pop(context);
Utils.showLoading(context);
RegisterUserRespModel user = await userRepo.basicVerify(phoneNum, code, basicOtp.data!.userToken ?? "");
RegisterUserRespModel user = await userRepo.basicVerify(
phoneNum, code, basicOtp.data!.userToken ?? "");
Utils.hideLoading(context);
if (user.messageStatus == 1) {
Utils.showToast(user.message ?? "");
@ -493,7 +552,8 @@ class UserVM extends BaseVM {
//"Phone Number Verified",
onClick: () {
pop(context);
navigateWithName(context, AppRoutes.profile1, arguments: user);
navigateWithName(context, AppRoutes.profile1,
arguments: user);
},
),
);
@ -507,15 +567,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,
required String countryCode,
required String phoneNum,
required String password}) async {
Utils.showLoading(context);
Response response = await userRepo.loginV1(type == ClassType.NUMBER ? countryCode + phoneNum : phoneNum, password);
Response response = await userRepo.loginV1(
type == ClassType.NUMBER ? countryCode + phoneNum : phoneNum, password);
Utils.hideLoading(context);
LoginPasswordRespModel user = LoginPasswordRespModel.fromJson(jsonDecode(response.body));
LoginPasswordRespModel user =
LoginPasswordRespModel.fromJson(jsonDecode(response.body));
if (user.messageStatus == 1) {
SharedPrefManager.setPhoneOrEmail(type == ClassType.NUMBER ? countryCode + phoneNum : phoneNum);
SharedPrefManager.setPhoneOrEmail(
type == ClassType.NUMBER ? countryCode + phoneNum : phoneNum);
SharedPrefManager.setUserPassword(password);
navigateReplaceWithName(context, AppRoutes.loginMethodSelection, arguments: user.data!.userToken);
navigateReplaceWithName(context, AppRoutes.loginMethodSelection,
arguments: user.data!.userToken);
} else {
Utils.showToast(user.message ?? "");
}
@ -526,9 +594,14 @@ class UserVM extends BaseVM {
}
Future<void> performBasicOtpRegisterPage(BuildContext context,
{required String countryCode, required String phoneNum, required int role, bool isNeedToPassToken = false, VoidCallback? reloadPage}) async {
{required String countryCode,
required String phoneNum,
required int role,
bool isNeedToPassToken = false,
VoidCallback? reloadPage}) async {
Utils.showLoading(context);
BasicOtpRespModel basicOtp = await userRepo.basicOtp(countryCode + phoneNum, roleId: role, isNeedToPassToken: isNeedToPassToken);
BasicOtpRespModel basicOtp = await userRepo.basicOtp(countryCode + phoneNum,
roleId: role, isNeedToPassToken: isNeedToPassToken);
Utils.hideLoading(context);
if (basicOtp.messageStatus == 1) {
showMDialog(context, child: OtpDialog(
@ -546,7 +619,9 @@ class UserVM extends BaseVM {
Utils.showToast(user.message ?? "");
user.data!.roleId = role;
user.data!.isNeedToPassToken = isNeedToPassToken;
navigateReplaceWithName(context, AppRoutes.completeProfile, arguments: user).then((value) {
navigateReplaceWithName(context, AppRoutes.completeProfile,
arguments: user)
.then((value) {
if (reloadPage != null) {
reloadPage();
}
@ -572,7 +647,8 @@ class UserVM extends BaseVM {
}) async {
bool auth = await CommonAuthImp().authenticate();
if (auth) {
performBasicOtpLoginSelectionPage(context!, userToken: userToken!, appType: apptype!, loginType: loginType);
performBasicOtpLoginSelectionPage(context!,
userToken: userToken!, appType: apptype!, loginType: loginType);
}
}
@ -590,7 +666,8 @@ class UserVM extends BaseVM {
}
Future<void> updateUserImage(BuildContext context) async {
File? myPick = await commanServices.pickFile(context, fileType: FileType.image);
File? myPick =
await commanServices.pickFile(context, fileType: FileType.image);
if (myPick != null) {
userRepo.updateUserImage(encodeBase64Image(myPick)).whenComplete(() {
AppState().getUser.data!.userInfo!.userLocalImage = myPick;

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

@ -1,12 +1,10 @@
import 'dart:async';
import 'dart:convert';
import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:mc_common_app/classes/consts.dart';
import 'package:mc_common_app/config/routes.dart';
import 'package:mc_common_app/extensions/int_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/models/advertisment_models/ad_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/txt_field.dart';
import 'package:provider/provider.dart';
import 'package:easy_localization/easy_localization.dart';
class AdsDetailView extends StatefulWidget {
final AdDetailsModel adDetails;
@ -62,12 +61,12 @@ class _AdsDetailViewState extends State<AdsDetailView> {
AdVM adVM = context.read<AdVM>();
return actionConfirmationBottomSheet(
context: context,
title: "Do you want to delete the ad?".toText(fontSize: 28, isBold: true, letterSpacing: -1.44),
subtitle: "Your ad will be permanently deleted and you cannot undo this action.",
title: LocaleKeys.deleteAdConfirmation.tr().toText(fontSize: 28, isBold: true, letterSpacing: -1.44),
subtitle: LocaleKeys.deleteAdConfirmationMessage.tr(),
actionButtonYes: Expanded(
child: ShowFillButton(
maxHeight: 55,
title: "Yes",
title: LocaleKeys.yes.tr(),
fontSize: 15,
onPressed: () {
Navigator.pop(context);
@ -80,7 +79,7 @@ class _AdsDetailViewState extends State<AdsDetailView> {
maxHeight: 55,
isFilled: false,
borderColor: MyColors.darkPrimaryColor,
title: "No",
title: LocaleKeys.no.tr(),
txtColor: MyColors.darkPrimaryColor,
fontSize: 15,
onPressed: () {
@ -95,7 +94,7 @@ class _AdsDetailViewState extends State<AdsDetailView> {
Widget build(BuildContext context) {
return Scaffold(
appBar: CustomAppBar(
title: "Ads",
title: LocaleKeys.ads.tr(),
profileImageUrl: MyAssets.bnCar,
isRemoveBackButton: false,
isDrawerEnabled: false,
@ -155,7 +154,7 @@ class _AdsDetailViewState extends State<AdsDetailView> {
children: [
Row(
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(
fontSize: 14,
isBold: true,
@ -170,7 +169,7 @@ class _AdsDetailViewState extends State<AdsDetailView> {
children: [
Row(
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(
fontSize: 14,
isBold: true,
@ -184,7 +183,7 @@ class _AdsDetailViewState extends State<AdsDetailView> {
),
Row(
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(
fontSize: 14,
isBold: true,
@ -192,26 +191,26 @@ class _AdsDetailViewState extends State<AdsDetailView> {
],
),
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(
fontSize: 14,
isBold: true,
),
if (widget.adDetails.isMyAd ?? false) ...[
8.height,
"Demand: ".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
(LocaleKeys.demand.tr() + ": ").toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
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) ...[
8.height,
const Divider(thickness: 1, height: 1),
8.height,
"Your Ad Duration time is over.".toText(
LocaleKeys.adDurationExpired.tr().toText(
color: MyColors.redColor,
fontSize: 12,
isItalic: true,
@ -227,7 +226,7 @@ class _AdsDetailViewState extends State<AdsDetailView> {
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"Bank Details".toText(fontSize: 18, isBold: true),
LocaleKeys.bankDetails.tr().toText(fontSize: 18, isBold: true),
// Row(
// children: [
// "Full Name: ".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
@ -239,7 +238,7 @@ class _AdsDetailViewState extends State<AdsDetailView> {
// ),
Row(
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(
fontSize: 14,
isBold: true,
@ -248,7 +247,7 @@ class _AdsDetailViewState extends State<AdsDetailView> {
),
Row(
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(
fontSize: 14,
isBold: true,
@ -270,10 +269,10 @@ class _AdsDetailViewState extends State<AdsDetailView> {
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"Rejection Comments".toText(fontSize: 13, isBold: true, color: MyColors.lightTextColor),
LocaleKeys.rejectionComments.tr().toText(fontSize: 13, isBold: true, color: MyColors.lightTextColor),
Row(
children: [
"Edit Ad".toText(fontSize: 10, isBold: true),
LocaleKeys.editAd.tr().toText(fontSize: 10, isBold: true),
2.width,
const Icon(Icons.edit, size: 15),
],
@ -312,7 +311,7 @@ class _AdsDetailViewState extends State<AdsDetailView> {
crossAxisAlignment: CrossAxisAlignment.end,
children: [
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,
@ -340,37 +339,37 @@ class BuildAdDetailsActionButtonForExploreAds extends StatelessWidget {
enableDrag: true,
builder: (BuildContext context) {
return InfoBottomSheet(
title: "Reserve Ad".toText(fontSize: 24, isBold: true),
title: LocaleKeys.reserveAd.tr().toText(fontSize: 24, isBold: true),
description: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"Reservation Amount".toText(fontSize: 16, isBold: true),
LocaleKeys.reservationAmount.tr().toText(fontSize: 16, isBold: true),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
"${adDetailsModel.reservePrice}".toText(fontSize: 19, isBold: true),
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(),
"Below Amount that you will pay later".toText(fontSize: 12),
LocaleKeys.belowAmountPayLater.tr().toText(fontSize: 12),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
"Car Price".toText(fontSize: 16, isBold: true),
LocaleKeys.carPrice.tr().toText(fontSize: 16, isBold: true),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
"${adDetailsModel.vehicle!.demandAmount ?? 0.0}".toText(fontSize: 19, isBold: true),
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,
mainAxisAlignment: MainAxisAlignment.end,
children: [
"VAT Excluded".toText(fontSize: 10, isBold: true),
LocaleKeys.vatExcluded.tr().toText(fontSize: 10, isBold: true),
],
),
const Divider(),
"Special Services".toText(fontSize: 16, isBold: true),
LocaleKeys.specialService.toText(fontSize: 16, isBold: true),
5.height,
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"Car insurance Service".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor, fontWeight: FontWeight.w500),
"To be Decided".toText(fontSize: 12, isBold: true),
LocaleKeys.carInsuranceService.tr().toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor, fontWeight: FontWeight.w500),
LocaleKeys.toBeDecided.tr().toText(fontSize: 12, isBold: true),
],
),
5.height,
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"Registration & Car Plates".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
"To be Decided".toText(fontSize: 12, isBold: true),
LocaleKeys.registrationCarPlates.tr().toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
LocaleKeys.toBeDecided.tr().toText(fontSize: 12, isBold: true),
],
),
5.height,
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"Home Delivery Service".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
"To be Decided".toText(fontSize: 12, isBold: true),
LocaleKeys.homeDeliveryService.tr().toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
LocaleKeys.toBeDecided.tr().toText(fontSize: 12, isBold: true),
],
),
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,
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"Total Amount ".toText(fontSize: 16, isBold: true),
LocaleKeys.totalAmount.tr().toText(fontSize: 16, isBold: true),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
"${(adDetailsModel.vehicle!.demandAmount ?? 0.0)}".toText(fontSize: 19, isBold: true),
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,
mainAxisAlignment: MainAxisAlignment.end,
children: [
"Estimated".toText(fontSize: 10, isBold: true),
LocaleKeys.estimated.tr().toText(fontSize: 10, isBold: true),
],
),
30.height,
@ -442,7 +441,7 @@ class BuildAdDetailsActionButtonForExploreAds extends StatelessWidget {
size: 19,
).paddingOnly(bottom: 2),
3.width,
"Some services are mandatory while reserving Ad.".toText(
LocaleKeys.servicesReservingAd.tr().toText(
color: MyColors.adPendingStatusColor,
fontSize: 12,
isItalic: true,
@ -455,7 +454,7 @@ class BuildAdDetailsActionButtonForExploreAds extends StatelessWidget {
Expanded(
child: ShowFillButton(
maxHeight: 55,
title: "Complete Reservation",
title: LocaleKeys.completeReservation.tr(),
onPressed: () async {
// Navigator.pop(context);
bool status = await context.read<AdVM>().createReserveAd(adId: adDetailsModel.id!, context: context);
@ -479,7 +478,7 @@ class BuildAdDetailsActionButtonForExploreAds extends StatelessWidget {
Expanded(
child: ShowFillButton(
maxHeight: 55,
title: "Reserve Ad",
title: LocaleKeys.reserveAd.tr(),
onPressed: () {
reserveAdPriceBreakDownClicked(context, adDetailsModel);
// navigateWithName(context, AppRoutes.paymentMethodsView);
@ -523,7 +522,7 @@ class BuildAdDetailsActionButtonForExploreAds extends StatelessWidget {
Expanded(
child: ShowFillButton(
maxHeight: 55,
title: "Contact",
title: LocaleKeys.contact.tr(),
fontSize: 18,
isBold: false,
iconWidget: const Padding(
@ -584,7 +583,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
builder: (BuildContext context) {
return Consumer(builder: (BuildContext context, AdVM adVM, Widget? child) {
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(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -604,7 +603,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
// here the item price is the index of the selected option
list: vehicleCitiesDrop,
dropdownValue: adVM.photoOfficeSelectedId.selectedId != -1 ? DropValue(adVM.photoOfficeSelectedId.selectedId, adVM.photoOfficeSelectedId.selectedOption, "") : null,
hint: "Select Office",
hint: LocaleKeys.selectOffice.tr(),
errorValue: adVM.photoOfficeSelectedId.errorValue,
);
},
@ -621,7 +620,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
("Available Slots").toText(fontSize: 14, isBold: true),
LocaleKeys.availableSlots.tr().toText(fontSize: 14, isBold: true),
],
),
5.height,
@ -640,7 +639,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
Expanded(
child: ShowFillButton(
maxHeight: 55,
title: "Book and Pay",
title: LocaleKeys.bookAndPay.tr(),
fontSize: 15,
onPressed: () {
adVM.onAdSSBookAppointmentPressed(context, adDetailsModel: adDetailsModel, adsSpecialServiceID: 1); //1 for photography Service
@ -665,37 +664,37 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
enableDrag: true,
builder: (BuildContext context) {
return InfoBottomSheet(
title: "Reserve Ad".toText(fontSize: 24, isBold: true),
title: LocaleKeys.reserveAd.tr().toText(fontSize: 24, isBold: true),
description: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"Reservation Amounts".toText(fontSize: 16, isBold: true),
LocaleKeys.reservationAmounts.tr().toText(fontSize: 16, isBold: true),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
"500".toText(fontSize: 19, isBold: true),
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(),
"Below Amount that you will pay later".toText(fontSize: 12),
LocaleKeys.belowAmountPayLater.tr().toText(fontSize: 12),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
"Car Price".toText(fontSize: 16, isBold: true),
LocaleKeys.carPrice.tr().toText(fontSize: 16, isBold: true),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
"30,000".toText(fontSize: 19, isBold: true),
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,13 +702,13 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"Tax".toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
LocaleKeys.tax.tr().toText(fontSize: 14, isBold: true, color: MyColors.lightTextColor),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
"4,500".toText(fontSize: 16, isBold: true),
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),
],
)
],
@ -953,10 +952,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
return InfoBottomSheet(
title: "Cancel Reservation".toText(fontSize: 28, isBold: true, letterSpacing: -1.44),
description: Padding(
padding: EdgeInsets.only(bottom: MediaQuery
.of(context)
.viewInsets
.bottom),
padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
child: Consumer<AdVM>(
builder: (BuildContext context, AdVM adVM, Widget? child) {
return Column(
@ -1072,10 +1068,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
return InfoBottomSheet(
title: "Upload Bank Receipt".toText(fontSize: 26, isBold: true, letterSpacing: -1.44),
description: Padding(
padding: EdgeInsets.only(bottom: MediaQuery
.of(context)
.viewInsets
.bottom),
padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
child: Consumer<AdVM>(
builder: (BuildContext context, AdVM adVM, Widget? child) {
return Column(
@ -1107,8 +1100,7 @@ class BuildAdDetailsActionButtonForMyAds extends StatelessWidget {
},
isPdf: true,
),
] else
...[
] else ...[
Row(
children: [
Container(

Loading…
Cancel
Save