BASE: Create AppRouter Util.

This commit is contained in:
2025-12-04 15:20:19 +05:00
parent 841cdf8c21
commit 157545f1c0
11 changed files with 580 additions and 298 deletions

View File

@@ -118,6 +118,10 @@
"allowLocation": "Allow location access to discover beauty stores and services near you.",
"useCurrentLocation": "Use current location",
"setFromMap": "Set from map",
"enterManuallyLocation": "Enter Manually location"
"enterManuallyLocation": "Enter Manually location",
"changeLanguage": "Change Language",
"selectPrefferedLanguage": "Select your preferred language for a personalized app experience."
}

View File

@@ -1,108 +1,124 @@
{
"loginToExplore" : "Log in to explore your all in one vendor app favourites and shop effortlessly.",
"emailAddress": "Email Address*",
"password": "Password*",
"enterPassword": "Enter password",
"forgotPassword": "Forgot Password",
"login": "Log in",
"orContinueWith": "or continue with",
"withGoogle": "with Google",
"withApple": "with Apple",
"dontHaveAccount": "Didn't have an account?",
"signUp": "Sign up",
"skip": "Skip",
"signUpToExplore": "Sign up to explore all our services and start shopping, riding, and more.",
"firstName": "First Name*",
"lastName": "Last Name*",
"enterMobileNumber": "Enter Mobile number",
"confirmPassword": "Confirm Password*",
"enterConfirmPassword": "Enter confirm password",
"referralCode": "Referral Code",
"enterReferralCode": "Enter referral code",
"alreadyHaveAccount":"Already have an account?",
"enterYourregisteredEmail": "Enter your registered email to receive a reset link.",
"sendLink": "Send Link",
"rememberPassword": "Remember Password?",
"enterOtpSent": "Enter the OTP sent to your mobile",
"resendOTP": "Resend OTP",
"verify": "Verify",
"useYourMobileNumber": "Use your mobile number to Log in easily and securely.",
"sendCode":"Send Code",
"serviceIsUnavailable": "Service is unavailable at the selected address.",
"pickUpLocation": "Pickup Location",
"destinationLocation": "Destination Location",
"continueT":"Continue",
"plsSelectSourceLocation": "Please select source location",
"plsSelectDestinationLocations": "Please select destination location",
"selectVehicleType": "Select Your Vehicle Type",
"plsSelectVehicleTypeFirst": "Please select a vehicle type first.",
"plsSelectPaymentMethod": "Please select a payment method",
"insufficientWallet": "Insufficient wallet balance. Please select another payment method.",
"promoCode": "Promo code",
"thisOfferNotEligible": "This offer not eligible for this booking",
"viewAll": "View All",
"writeCoupon": "Write coupon Code",
"redeemNow": "Redeem now",
"plsEnterCouponCode":"Please enter a coupon code",
"couponApplied": "Coupon applied successfully",
"couponExpired": "This coupon code has been expired",
"invalidCouponCode": "Invalid coupon code",
"orderSummary": "Order Summary",
"subtotal": "Subtotal",
"discount": "Discount",
"orderTotal": "Order Total",
"confirmBooking": "Confirm Booking",
"waitingForDriver": "Waiting for driver....",
"cancelRide": "Cancel Ride",
"riderCancelledSucces": "Ride cancelled successfully",
"failedToCancel": "Failed to cancel ride",
"pleaseWait": "Please wait...",
"change": "Change",
"yourSosRequest": "Your SOS request has been submitted to admin",
"yourSosrequestAlreadySubmitted": "Your SOS request is already submitted",
"payNow": "Pay Now",
"youDoNothaveSufficientwalletBalance": "You do not have sufficient wallet balance",
"somethingWentWrong": "Something went wrong, please contact admin.",
"cash": "Cash",
"coupon": "Coupon",
"couponNotFound": "Coupon not found.",
"tapToApply": "Tap To Apply",
"home": "Home",
"myBookings": "My Bookings",
"profile": "profile",
"wallet": "Wallet",
"cabServiceType": "Cab Service Type",
"everyRideVerified": "Every Ride. Every Driver. Verified.",
"allDriversIDCheck": "All drivers go through ID checks and background verification for your safety.",
"intercity": "Intercity",
"aroundTheCity": "Around the city",
"rideDetails": "Ride Details",
"orderId": "Order Id:",
"bookingData": "Booking Date:",
"rideAndFareSummary": "Ride & Fare Summary",
"updateReview": "Update Review",
"addReview": "Add Review",
"complain": "Complain",
"distance": "Distance",
"km": "KM",
"duration": "Duration",
"howWasTrip": "How was your trip?",
"yourFeedbackWillHelp": "Your feedback will help us improve \n driving experience better",
"rateFor": "Rate for",
"typeComment": "Type comment....",
"title": "Title",
"typeDescription": "Type Description...",
"save": "Save",
"popularDestinations": "Popular Destinations",
"selectPaymentMethod": "Select Payment Method",
"prefferedPayment": "Preferred Payment",
"otherPaymentOptions": "Other Payment Options",
"rideHistory": "Ride History",
"plsLoginToAcc": "Please Log In to Continue",
"youAreNotLoggedIn": "Youre not logged in. Please sign in to access your account and explore all features.",
"noOrderfound": "No order found",
"reset_password_link_sent": "A reset link has been sent to {email}",
"pay_amount": "Pay Amount: {amount}"
"loginToExplore" : "Войдите, чтобы исследовать наш универсальный сервис и делать покупки с удобством.",
"emailAddress": "Адрес электронной почты*",
"password": "Пароль*",
"enterPassword": "Введите пароль",
"forgotPassword": "Забыли пароль",
"login": "Войти",
"orContinueWith": "или продолжить с",
"withGoogle": "с Google",
"withApple": "с Apple",
"dontHaveAccount": "Нет аккаунта?",
"signUp": "Зарегистрироваться",
"skip": "Пропустить",
"signUpToExplore": "Зарегистрируйтесь, чтобы получить доступ ко всем нашим услугам и начать делать покупки, поездки и многое другое.",
"firstName": "Имя*",
"lastName": "Фамилия*",
"enterMobileNumber": "Введите номер телефона",
"confirmPassword": "Подтвердите пароль*",
"enterConfirmPassword": "Введите подтверждение пароля",
"referralCode": "Реферальный код",
"enterReferralCode": "Введите реферальный код",
"alreadyHaveAccount": "Уже есть аккаунт?",
"enterYourregisteredEmail": "Введите свою зарегистрированную почту, чтобы получить ссылку для сброса.",
"sendLink": "Отправить ссылку",
"rememberPassword": "Вспомнили пароль?",
"enterOtpSent": "Введите код, отправленный на ваш телефон",
"resendOTP": "Отправить код повторно",
"verify": "Подтвердить",
"useYourMobileNumber": "Используйте номер телефона для быстрого и безопасного входа.",
"sendCode": "Отправить код",
"serviceIsUnavailable": "Услуга недоступна по выбранному адресу.",
"pickUpLocation": "Место отправления",
"destinationLocation": "Место назначения",
"continueT": "Продолжить",
"plsSelectSourceLocation": "Пожалуйста, выберите место отправления",
"plsSelectDestinationLocations": "Пожалуйста, выберите место назначения",
"selectVehicleType": "Выберите тип транспорта",
"plsSelectVehicleTypeFirst": "Сначала выберите тип транспорта.",
"plsSelectPaymentMethod": "Пожалуйста, выберите способ оплаты",
"insufficientWallet": "Недостаточно средств в кошельке. Пожалуйста, выберите другой способ оплаты.",
"promoCode": "Промокод",
"thisOfferNotEligible": "Это предложение недоступно для данного заказа",
"viewAll": "Показать все",
"writeCoupon": "Введите промокод",
"redeemNow": "Применить",
"plsEnterCouponCode": "Пожалуйста, введите промокод",
"couponApplied": "Промокод успешно применён",
"couponExpired": "Срок действия этого промокода истёк",
"invalidCouponCode": "Неверный промокод",
"orderSummary": "Сводка заказа",
"subtotal": "Промежуточный итог",
"discount": "Скидка",
"orderTotal": "Итого",
"confirmBooking": "Подтвердить заказ",
"waitingForDriver": "Ожидание водителя....",
"cancelRide": "Отменить поездку",
"riderCancelledSucces": "Поездка успешно отменена",
"failedToCancel": "Не удалось отменить поездку",
"pleaseWait": "Пожалуйста, подождите...",
"change": "Изменить",
"yourSosRequest": "Ваш SOS-запрос отправлен администратору",
"yourSosrequestAlreadySubmitted": "Ваш SOS-запрос уже отправлен",
"payNow": "Оплатить сейчас",
"youDoNothaveSufficientwalletBalance": "Недостаточно средств в кошельке",
"somethingWentWrong": "Произошла ошибка, пожалуйста, свяжитесь с администратором.",
"cash": "Наличные",
"coupon": "Промокод",
"couponNotFound": "Промокод не найден.",
"tapToApply": "Нажмите, чтобы применить",
"home": "Главная",
"myBookings": "Мои заказы",
"profile": "Профиль",
"wallet": "Кошелёк",
"cabServiceType": "Тип такси",
"everyRideVerified": "Каждая поездка. Каждый водитель. Проверены.",
"allDriversIDCheck": "Все водители проходят проверку документов и биографии для вашей безопасности.",
"intercity": "Междугородние",
"aroundTheCity": "По городу",
"rideDetails": "Детали поездки",
"orderId": "ID заказа:",
"bookingData": "Дата заказа:",
"rideAndFareSummary": "Детали поездки и стоимость",
"updateReview": "Обновить отзыв",
"addReview": "Добавить отзыв",
"complain": "Жалоба",
"distance": "Расстояние",
"km": "км",
"duration": "Продолжительность",
"howWasTrip": "Как прошла поездка?",
"yourFeedbackWillHelp": "Ваш отзыв поможет нам улучшить \n качество поездок",
"rateFor": "Оценка для",
"typeComment": "Введите комментарий....",
"title": "Заголовок",
"typeDescription": "Введите описание...",
"save": "Сохранить",
"popularDestinations": "Популярные направления",
"selectPaymentMethod": "Выберите способ оплаты",
"prefferedPayment": "Предпочтительный способ оплаты",
"otherPaymentOptions": "Другие способы оплаты",
"rideHistory": "История поездок",
"plsLoginToAcc": "Пожалуйста, войдите, чтобы продолжить",
"youAreNotLoggedIn": "Вы не вошли в систему. Пожалуйста, войдите, чтобы получить доступ к аккаунту и функциям.",
"noOrderfound": "Заказов не найдено",
"reset_password_link_sent": "Ссылка для сброса отправлена на {email}",
"pay_amount": "Сумма к оплате: {amount}",
"otherServices": "Другие услуги",
"foodDelivery": "Доставка еды",
"delivery": "Доставка",
"bookingTaxi": "Заказ \nТакси",
"updateYourWardrobe": "Обновите гардероб",
"weDeliverSafely": "Мы доставляем безопасно",
"rent": "Аренда",
"hugeSelectionOfAds": "Огромный выбор объявлений!",
"cosmetics": "Косметика",
"moreThan1000Products": "Более 1000 товаров",
"foodProducts": "Продукты питания",
"enableLocation": "Включите геолокацию",
"allowLocation": "Разрешите доступ к геолокации, чтобы найти магазины и услуги рядом с вами.",
"useCurrentLocation": "Использовать текущую геолокацию",
"setFromMap": "Выбрать на карте",
"enterManuallyLocation": "Введите адрес вручную",
"changeLanguage": "Изменить язык",
"selectPrefferedLanguage": "Выберите предпочитаемый язык для персонализированного использования приложения."
}

View File

@@ -1,108 +1,124 @@
{
"loginToExplore" : "Log in to explore your all in one vendor app favourites and shop effortlessly.",
"emailAddress": "Email Address*",
"password": "Password*",
"enterPassword": "Enter password",
"forgotPassword": "Forgot Password",
"login": "Log in",
"orContinueWith": "or continue with",
"withGoogle": "with Google",
"withApple": "with Apple",
"dontHaveAccount": "Didn't have an account?",
"signUp": "Sign up",
"skip": "Skip",
"signUpToExplore": "Sign up to explore all our services and start shopping, riding, and more.",
"firstName": "First Name*",
"lastName": "Last Name*",
"enterMobileNumber": "Enter Mobile number",
"confirmPassword": "Confirm Password*",
"enterConfirmPassword": "Enter confirm password",
"referralCode": "Referral Code",
"enterReferralCode": "Enter referral code",
"alreadyHaveAccount":"Already have an account?",
"enterYourregisteredEmail": "Enter your registered email to receive a reset link.",
"sendLink": "Send Link",
"rememberPassword": "Remember Password?",
"enterOtpSent": "Enter the OTP sent to your mobile",
"resendOTP": "Resend OTP",
"verify": "Verify",
"useYourMobileNumber": "Use your mobile number to Log in easily and securely.",
"sendCode":"Send Code",
"serviceIsUnavailable": "Service is unavailable at the selected address.",
"pickUpLocation": "Pickup Location",
"destinationLocation": "Destination Location",
"continueT":"Continue",
"plsSelectSourceLocation": "Please select source location",
"plsSelectDestinationLocations": "Please select destination location",
"selectVehicleType": "Select Your Vehicle Type",
"plsSelectVehicleTypeFirst": "Please select a vehicle type first.",
"plsSelectPaymentMethod": "Please select a payment method",
"insufficientWallet": "Insufficient wallet balance. Please select another payment method.",
"promoCode": "Promo code",
"thisOfferNotEligible": "This offer not eligible for this booking",
"viewAll": "View All",
"writeCoupon": "Write coupon Code",
"redeemNow": "Redeem now",
"plsEnterCouponCode":"Please enter a coupon code",
"couponApplied": "Coupon applied successfully",
"couponExpired": "This coupon code has been expired",
"invalidCouponCode": "Invalid coupon code",
"orderSummary": "Order Summary",
"subtotal": "Subtotal",
"discount": "Discount",
"orderTotal": "Order Total",
"confirmBooking": "Confirm Booking",
"waitingForDriver": "Waiting for driver....",
"cancelRide": "Cancel Ride",
"riderCancelledSucces": "Ride cancelled successfully",
"failedToCancel": "Failed to cancel ride",
"pleaseWait": "Please wait...",
"change": "Change",
"yourSosRequest": "Your SOS request has been submitted to admin",
"yourSosrequestAlreadySubmitted": "Your SOS request is already submitted",
"payNow": "Pay Now",
"youDoNothaveSufficientwalletBalance": "You do not have sufficient wallet balance",
"somethingWentWrong": "Something went wrong, please contact admin.",
"cash": "Cash",
"coupon": "Coupon",
"couponNotFound": "Coupon not found.",
"tapToApply": "Tap To Apply",
"home": "Home",
"myBookings": "My Bookings",
"profile": "profile",
"wallet": "Wallet",
"cabServiceType": "Cab Service Type",
"everyRideVerified": "Every Ride. Every Driver. Verified.",
"allDriversIDCheck": "All drivers go through ID checks and background verification for your safety.",
"intercity": "Intercity",
"aroundTheCity": "Around the city",
"rideDetails": "Ride Details",
"orderId": "Order Id:",
"bookingData": "Booking Date:",
"rideAndFareSummary": "Ride & Fare Summary",
"updateReview": "Update Review",
"addReview": "Add Review",
"complain": "Complain",
"distance": "Distance",
"km": "KM",
"duration": "Duration",
"howWasTrip": "How was your trip?",
"yourFeedbackWillHelp": "Your feedback will help us improve \n driving experience better",
"rateFor": "Rate for",
"typeComment": "Type comment....",
"title": "Title",
"typeDescription": "Type Description...",
"save": "Save",
"popularDestinations": "Popular Destinations",
"selectPaymentMethod": "Select Payment Method",
"prefferedPayment": "Preferred Payment",
"otherPaymentOptions": "Other Payment Options",
"rideHistory": "Ride History",
"plsLoginToAcc": "Please Log In to Continue",
"youAreNotLoggedIn": "Youre not logged in. Please sign in to access your account and explore all features.",
"noOrderfound": "No order found",
"reset_password_link_sent": "A reset link has been sent to {email}",
"pay_amount": "Pay Amount: {amount}"
"loginToExplore" : "Barcha xizmatlarimizdan foydalanish va qulay xarid qilish uchun tizimga kiring.",
"emailAddress": "Email manzil*",
"password": "Parol*",
"enterPassword": "Parolni kiriting",
"forgotPassword": "Parolni unutdingizmi",
"login": "Kirish",
"orContinueWith": "yoki davom eting",
"withGoogle": "Google orqali",
"withApple": "Apple orqali",
"dontHaveAccount": "Hisobingiz yoqmi?",
"signUp": "Royxatdan otish",
"skip": "Otkazib yuborish",
"signUpToExplore": "Royxatdan oting va barcha xizmatlarimizdan foydalanishni boshlang.",
"firstName": "Ism*",
"lastName": "Familiya*",
"enterMobileNumber": "Telefon raqamini kiriting",
"confirmPassword": "Parolni tasdiqlang*",
"enterConfirmPassword": "Tasdiqlash parolini kiriting",
"referralCode": "Referal kod",
"enterReferralCode": "Referal kodni kiriting",
"alreadyHaveAccount": "Hisobingiz bormi?",
"enterYourregisteredEmail": "Email manzilingizni kiriting — sizga parolni tiklash havolasi yuboriladi.",
"sendLink": "Havolani yuborish",
"rememberPassword": "Parol esingizga tushdimi?",
"enterOtpSent": "Telefoningizga yuborilgan kodni kiriting",
"resendOTP": "Kod qayta yuborilsin",
"verify": "Tasdiqlash",
"useYourMobileNumber": "Telefon raqamingiz orqali oson va xavfsiz kirishingiz mumkin.",
"sendCode": "Kod yuborish",
"serviceIsUnavailable": "Tanlangan manzilda xizmat mavjud emas.",
"pickUpLocation": "Jonash manzili",
"destinationLocation": "Borish manzili",
"continueT": "Davom etish",
"plsSelectSourceLocation": "Iltimos, jonash manzilini tanlang",
"plsSelectDestinationLocations": "Iltimos, borish manzilini tanlang",
"selectVehicleType": "Transport turini tanlang",
"plsSelectVehicleTypeFirst": "Avval transport turini tanlang.",
"plsSelectPaymentMethod": "Iltimos, tolov usulini tanlang",
"insufficientWallet": "Hamyonda mablag yetarli emas. Boshqa tolov usulini tanlang.",
"promoCode": "Promo kod",
"thisOfferNotEligible": "Bu taklif ushbu buyurtma uchun amal qilmaydi",
"viewAll": "Barchasini korish",
"writeCoupon": "Promo kodni kiriting",
"redeemNow": "Qollash",
"plsEnterCouponCode": "Iltimos, promo kodni kiriting",
"couponApplied": "Promo kod muvaffaqiyatli qollandi",
"couponExpired": "Ushbu promo kodning muddati tugagan",
"invalidCouponCode": "Notogri promo kod",
"orderSummary": "Buyurtma tafsilotlari",
"subtotal": "Oraliq summa",
"discount": "Chegirma",
"orderTotal": "Umumiy summa",
"confirmBooking": "Buyurtmani tasdiqlash",
"waitingForDriver": "Haydovchi kutilmoqda....",
"cancelRide": "Safarni bekor qilish",
"riderCancelledSucces": "Safar muvaffaqiyatli bekor qilindi",
"failedToCancel": "Safarni bekor qilish amalga oshmadi",
"pleaseWait": "Iltimos, kuting...",
"change": "Ozgartirish",
"yourSosRequest": "Sizning SOS sorovingiz administratorga yuborildi",
"yourSosrequestAlreadySubmitted": "SOS sorovi allaqachon yuborilgan",
"payNow": "Hozir tolash",
"youDoNothaveSufficientwalletBalance": "Hamyonda mablag yetarli emas",
"somethingWentWrong": "Xatolik yuz berdi, administrator bilan boglaning.",
"cash": "Naqd",
"coupon": "Promo kod",
"couponNotFound": "Promo kod topilmadi.",
"tapToApply": "Qollash uchun bosing",
"home": "Bosh sahifa",
"myBookings": "Buyurtmalarim",
"profile": "Profil",
"wallet": "Hamyon",
"cabServiceType": "Taksi xizmati turi",
"everyRideVerified": "Har bir safar. Har bir haydovchi. Tasdiqlangan.",
"allDriversIDCheck": "Barcha haydovchilar hujjat va tekshiruvdan otadi — xavfsizligingiz uchun.",
"intercity": "Shaharlararo",
"aroundTheCity": "Shahar boylab",
"rideDetails": "Safar tafsilotlari",
"orderId": "Buyurtma ID:",
"bookingData": "Buyurtma sanasi:",
"rideAndFareSummary": "Safar va tolov tafsilotlari",
"updateReview": "Sharhni yangilash",
"addReview": "Sharh qoldirish",
"complain": "Shikoyat",
"distance": "Masofa",
"km": "km",
"duration": "Davomiylik",
"howWasTrip": "Safar qanday otdi?",
"yourFeedbackWillHelp": "Fikringiz safar sifatini yanada yaxshilashga yordam beradi",
"rateFor": "Baholash:",
"typeComment": "Izoh yozing....",
"title": "Sarlavha",
"typeDescription": "Tavsif yozing...",
"save": "Saqlash",
"popularDestinations": "Mashhur yonalishlar",
"selectPaymentMethod": "Tolov usulini tanlang",
"prefferedPayment": "Afzal tolov usuli",
"otherPaymentOptions": "Boshqa tolov usullari",
"rideHistory": "Safar tarixi",
"plsLoginToAcc": "Davom etish uchun tizimga kiring",
"youAreNotLoggedIn": "Siz tizimga kirmagansiz. Hisobingizga kirib barcha funksiyalardan foydalaning.",
"noOrderfound": "Buyurtmalar topilmadi",
"reset_password_link_sent": "Parol tiklash havolasi {email} manziliga yuborildi",
"pay_amount": "Tolanadigan summa: {amount}",
"otherServices": "Boshqa xizmatlar",
"foodDelivery": "Oziq-ovqat yetkazib berish",
"delivery": "Yetkazib berish",
"bookingTaxi": "Taksi \nBuyurtma",
"updateYourWardrobe": "Garderobingizni yangilang",
"weDeliverSafely": "Biz xavfsiz yetkazib beramiz",
"rent": "Ijara",
"hugeSelectionOfAds": "Keng elonlar tanlovi!",
"cosmetics": "Kosmetika",
"moreThan1000Products": "1000 dan ortiq mahsulotlar",
"foodProducts": "Oziq-ovqat mahsulotlari",
"enableLocation": "Shaxsiylashtirilgan tajriba uchun geolokatsiyani yoqing",
"allowLocation": "Yaqin atrofdagi dokon va xizmatlarni topish uchun geolokatsiyaga ruxsat bering.",
"useCurrentLocation": "Joriy manzildan foydalanish",
"setFromMap": "Xaritadan tanlash",
"enterManuallyLocation": "Manzilni qolda kiriting",
"changeLanguage": "Tilni ozgartirish",
"selectPrefferedLanguage": "Shaxsiylashtirilgan tajriba uchun afzal tilni tanlang."
}

View File

@@ -120,7 +120,22 @@ class ConstTexts {
static String useCurrentLocation = "useCurrentLocation";
static String setFromMap = "setFromMap";
static String enterManuallyLocation = "enterManuallyLocation";
// static String intercity = "intercity";
static String changeLanguage = "changeLanguage";
static String selectPrefferedLanguage = "selectPrefferedLanguage";
// static String rideDetails = "rideDetails";
// static String youDoNothaveSufficientwalletBalance = "youDoNothaveSufficientwalletBalance";
// static String somethingWentWrong = "somethingWentWrong";
// static String cash = "cash";
// static String hugeSelectionOfAds = "hugeSelectionOfAds";
// static String cosmetics = "cosmetics";
// static String moreThan1000Products = "moreThan1000Products";
// static String foodProducts = "foodProducts";
// static String enableLocation = "enableLocation";
// static String allowLocation = "allowLocation";
// static String useCurrentLocation = "useCurrentLocation";
// static String setFromMap = "setFromMap";
// static String enterManuallyLocation = "enterManuallyLocation";
// static String changeLanguage = "changeLanguage";
// static String aroundTheCity = "aroundTheCity";
// static String rideDetails = "rideDetails";
// static String youDoNothaveSufficientwalletBalance = "youDoNothaveSufficientwalletBalance";

View File

@@ -7,6 +7,7 @@ import 'package:customer/screen_ui/service_home_screen/service_list_screen.dart'
import 'package:customer/utils/notification_service.dart';
import 'package:customer/utils/preferences.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart' hide Trans;
import '../screen_ui/auth_screens/login_screen.dart';
import '../screen_ui/location_enable_screens/location_permission_screen.dart';
@@ -14,9 +15,13 @@ import '../screen_ui/on_boarding_screen/on_boarding_screen.dart';
import '../service/fire_store_utils.dart';
class SplashController extends GetxController {
final BuildContext context;
SplashController({required this.context});
@override
void onInit() {
Timer(const Duration(seconds: 3), () => redirectScreen());
Timer(const Duration(seconds: 2), () => redirectScreen());
super.onInit();
}
@@ -73,4 +78,11 @@ class SplashController extends GetxController {
}
}
}
void _navigateAndRemoveAll(Widget screen) {
Navigator.of(context).pushAndRemoveUntil(
MaterialPageRoute(builder: (_) => screen),
(route) => false,
);
}
}

View File

@@ -2,11 +2,13 @@ import 'package:customer/screen_ui/splash_screen/splash_screen.dart';
import 'package:customer/service/localization_service.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:customer/themes/easy_loading_config.dart';
import 'package:customer/utils/app_router.dart';
import 'package:customer/utils/preferences.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_phoenix/flutter_phoenix.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'controllers/global_setting_controller.dart';
@@ -28,14 +30,14 @@ void main() async {
runApp(
EasyLocalization(
startLocale: Locale('en', 'US'),
startLocale: Locale('uz', 'UZ'),
supportedLocales: [
Locale('en', 'US'),
Locale('uz', 'UZ'),
Locale('ru', 'RU'),
],
path: 'assets/translations',
fallbackLocale: Locale('en', 'US'),
fallbackLocale: Locale('uz', 'UZ'),
child: MyApp(),
),
);
@@ -54,7 +56,8 @@ class MyApp extends StatelessWidget {
designSize: Size(375, 812),
minTextAdapt: true,
splitScreenMode: true,
child: GetMaterialApp(
child: MaterialApp(
navigatorKey: AppRouter.navigatorKey,
localizationsDelegates: context.localizationDelegates,
supportedLocales: context.supportedLocales,
locale: context.locale,
@@ -66,8 +69,7 @@ class MyApp extends StatelessWidget {
child: EasyLoading.init()(context, child),
);
},
translations: LocalizationService(),
fallbackLocale: LocalizationService.locale,
// fallbackLocale: LocalizationService.locale,
themeMode: themeController.themeMode,
theme: ThemeData(
scaffoldBackgroundColor: AppThemeData.surface,

View File

@@ -1,13 +1,15 @@
import 'dart:convert';
import 'package:customer/constant/constant.dart';
import 'package:customer/controllers/change_language_controller.dart';
import 'package:customer/screen_ui/splash_screen/splash_screen.dart';
import 'package:customer/themes/app_them_data.dart';
import 'package:customer/utils/network_image_widget.dart';
import 'package:customer/utils/preferences.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flag/flag_enum.dart';
import 'package:flag/flag_widget.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart' hide Trans;import '../../../controllers/theme_controller.dart';
import '../../../service/localization_service.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart' hide Trans;
import '../../../controllers/theme_controller.dart';
class ChangeLanguageScreen extends StatelessWidget {
const ChangeLanguageScreen({super.key});
@@ -20,81 +22,199 @@ class ChangeLanguageScreen extends StatelessWidget {
init: ChangeLanguageController(),
builder: (controller) {
return Scaffold(
appBar: AppBar(backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface, centerTitle: false, titleSpacing: 0),
appBar: AppBar(
backgroundColor:
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
centerTitle: false,
titleSpacing: 0,
leading: InkWell(
onTap: () {
// Get.back();
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(builder: (context) => SplashScreen()),
(route) => false,
);
},
child: Icon(Icons.arrow_back),
),
),
body:
controller.isLoading.value
? Constant.loader()
: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Change Language".tr(),
style: TextStyle(fontSize: 24, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
),
Text(
"Select your preferred language for a personalized app experience.".tr(),
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
),
const SizedBox(height: 20),
Expanded(
child: GridView.count(
crossAxisCount: 2,
childAspectRatio: (1.1 / 1),
crossAxisSpacing: 5,
mainAxisSpacing: 1,
children:
controller.languageList
.map(
(data) => Obx(
() => GestureDetector(
onTap: () {
LocalizationService().changeLocale(data.slug.toString());
Preferences.setString(Preferences.languageCodeKey, jsonEncode(data));
controller.selectedLanguage.value = data;
},
child: Container(
padding: const EdgeInsets.all(16),
child: Column(
children: [
NetworkImageWidget(imageUrl: data.image.toString(), height: 80, width: 80),
// SvgPicture.network(
// data.image.toString(),
// height: 80,
// width: 80,
// fit: BoxFit.contain,
// placeholderBuilder: (context) => const Center(child: CircularProgressIndicator(strokeWidth: 1.5)),
// ),
const SizedBox(height: 5),
Text(
"${data.title}",
style: TextStyle(
fontSize: 16,
color:
controller.selectedLanguage.value.slug == data.slug
? AppThemeData.primary300
: isDark
? AppThemeData.grey400
: AppThemeData.grey500,
fontFamily: AppThemeData.medium,
fontWeight: FontWeight.w400,
),
),
],
),
),
),
),
)
.toList(),
),
),
],
),
: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Padding(
// padding: const EdgeInsets.symmetric(horizontal: 16),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Text(
// ConstTexts.changeLanguage.tr(),
// style: TextStyle(
// fontSize: 24,
// color:
// isDark
// ? AppThemeData.grey50
// : AppThemeData.grey900,
// fontFamily: AppThemeData.semiBold,
// fontWeight: FontWeight.w500,
// ),
// ),
// Text(
// ConstTexts.selectPrefferedLanguage.tr(),
// style: TextStyle(
// fontSize: 16,
// color:
// isDark
// ? AppThemeData.grey50
// : AppThemeData.grey900,
// fontFamily: AppThemeData.regular,
// fontWeight: FontWeight.w400,
// ),
// ),
// ],
// ),
// ),
_buildLanguageButton(
isActive: context.locale == Locale("uz", "UZ"),
flagCode: FlagsCode.UZ,
title: "O'zbekcha",
onTap: () async {
await context.setLocale(Locale("uz", "UZ"));
Get.forceAppUpdate();
},
),
_buildDivider(),
_buildLanguageButton(
isActive: context.locale == Locale("ru", "RU"),
flagCode: FlagsCode.RU,
title: "Русский",
onTap: () async {
await context.setLocale(Locale("ru", "RU"));
Get.forceAppUpdate();
},
),
_buildDivider(),
_buildLanguageButton(
isActive: context.locale == Locale("en", "US"),
flagCode: FlagsCode.US,
title: "English",
onTap: () async {
await context.setLocale(Locale("en", "US"));
Get.forceAppUpdate();
},
),
// Expanded(
// child: GridView.count(
// crossAxisCount: 2,
// childAspectRatio: (1.1 / 1),
// crossAxisSpacing: 5,
// mainAxisSpacing: 1,
// children:
// controller.languageList
// .map(
// (data) => Obx(
// () => GestureDetector(
// onTap: () {
// LocalizationService().changeLocale(data.slug.toString());
// Preferences.setString(Preferences.languageCodeKey, jsonEncode(data));
// controller.selectedLanguage.value = data;
// },
// child: Container(
// padding: const EdgeInsets.all(16),
// child: Column(
// children: [
// NetworkImageWidget(imageUrl: data.image.toString(), height: 80, width: 80),
// // SvgPicture.network(
// // data.image.toString(),
// // height: 80,
// // width: 80,
// // fit: BoxFit.contain,
// // placeholderBuilder: (context) => const Center(child: CircularProgressIndicator(strokeWidth: 1.5)),
// // ),
// const SizedBox(height: 5),
// Text(
// "${data.title}",
// style: TextStyle(
// fontSize: 16,
// color:
// controller.selectedLanguage.value.slug == data.slug
// ? AppThemeData.primary300
// : isDark
// ? AppThemeData.grey400
// : AppThemeData.grey500,
// fontFamily: AppThemeData.medium,
// fontWeight: FontWeight.w400,
// ),
// ),
// ],
// ),
// ),
// ),
// ),
// )
// .toList(),
// ),
// ),
],
),
);
},
);
}
Widget _buildDivider() => Padding(
padding: EdgeInsetsGeometry.symmetric(horizontal: 16.r),
child: Divider(thickness: 1.2.r),
);
InkWell _buildLanguageButton({
required bool isActive,
required VoidCallback onTap,
required String title,
required FlagsCode flagCode,
}) {
return InkWell(
hoverColor: Colors.transparent,
splashColor: Colors.transparent,
overlayColor: WidgetStatePropertyAll(Colors.transparent),
onTap: onTap,
child: Padding(
padding: EdgeInsets.symmetric(vertical: 15.r).copyWith(right: 16.r),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Flag.fromCode(
flagCode,
height: 40.h,
width: 90.w,
borderRadius: 12.r,
),
Text(
title,
style: AppThemeData.mediumTextStyle(
fontSize: 16.sp,
color: AppThemeData.darkGrey,
),
),
],
),
isActive
? Icon(
Icons.circle,
color: AppThemeData.darkGrey.withValues(alpha: 0.6),
size: 15.r,
)
: SizedBox.shrink(),
],
),
),
);
}
}

View File

@@ -9,12 +9,16 @@ class SplashScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GetBuilder<SplashController>(
init: SplashController(),
init: SplashController(context: context),
builder: (controller) {
return Scaffold(
backgroundColor: AppThemeData.mainColor,
body: Center(
child: Image.asset("assets/images/fondex_logo_main.png", width: 120, height: 120),
child: Image.asset(
"assets/images/fondex_logo_main.png",
width: 120,
height: 120,
),
),
);
},

42
lib/utils/app_router.dart Normal file
View File

@@ -0,0 +1,42 @@
import 'package:flutter/material.dart';
class AppRouter {
static final GlobalKey<NavigatorState> navigatorKey =
GlobalKey<NavigatorState>();
static void close() {
if (navigatorKey.currentState?.canPop() ?? false) {
navigatorKey.currentState!.pop();
}
}
static void go(Widget page) {
navigatorKey.currentState?.push(_createRoute(page));
}
static void open(Widget page) {
navigatorKey.currentState?.pushAndRemoveUntil(
_createRoute(page),
(Route<dynamic> route) => false,
);
}
static PageRouteBuilder _createRoute(Widget page) {
return PageRouteBuilder(
transitionDuration: const Duration(milliseconds: 200),
reverseTransitionDuration: const Duration(milliseconds: 100),
pageBuilder: (context, animation, secondaryAnimation) => page,
transitionsBuilder: (context, animation, secondaryAnimation, child) {
final curvedAnimation = CurvedAnimation(
parent: animation,
curve: Curves.ease,
);
return ScaleTransition(
alignment: Alignment.center,
scale: Tween<double>(begin: 0.950, end: 1).animate(curvedAnimation),
child: child,
);
},
);
}
}

View File

@@ -209,6 +209,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.4.1"
country_flags:
dependency: "direct main"
description:
name: country_flags
sha256: "714f2d415e74828eb08787d552a05e94cdf2cbe0607a5656f3e70087cd7bb7e0"
url: "https://pub.dev"
source: hosted
version: "4.1.0"
cross_file:
dependency: transitive
description:
@@ -337,6 +345,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.0.2"
enum_to_string:
dependency: transitive
description:
name: enum_to_string
sha256: "93b75963d3b0c9f6a90c095b3af153e1feccb79f6f08282d3274ff8d9eea52bc"
url: "https://pub.dev"
source: hosted
version: "2.2.1"
equatable:
dependency: transitive
description:
@@ -537,6 +553,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.1.1"
flag:
dependency: "direct main"
description:
name: flag
sha256: "69e3e1d47453349ef72e2ebf4234b88024c0d57f9bcfaa7cc7facec49cd8561f"
url: "https://pub.dev"
source: hosted
version: "7.0.2"
flutter:
dependency: "direct main"
description: flutter
@@ -683,6 +707,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.2.1"
flutter_phoenix:
dependency: "direct main"
description:
name: flutter_phoenix
sha256: "39589dac934ea476d0e43fb60c1ddfba58f14960743640c8250dea11c4333378"
url: "https://pub.dev"
source: hosted
version: "1.1.1"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
@@ -1133,6 +1165,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.20.2"
jovial_misc:
dependency: transitive
description:
name: jovial_misc
sha256: "4301011027d87b8b919cb862db84071a34448eadbb32cc8d40fe505424dfe69a"
url: "https://pub.dev"
source: hosted
version: "0.9.2"
jovial_svg:
dependency: transitive
description:
name: jovial_svg
sha256: "08dd24b800d48796c9c0227acb96eb00c6cacccb1d7de58d79fc924090049868"
url: "https://pub.dev"
source: hosted
version: "1.1.28"
json_annotation:
dependency: transitive
description:

View File

@@ -90,6 +90,9 @@ dependencies:
flutter_hooks: ^0.21.3+1
easy_localization: ^3.0.8
flutter_localization: ^0.3.3
country_flags: ^4.1.0
flag: ^7.0.2
flutter_phoenix: ^1.1.1
dependency_overrides:
webview_flutter: ^4.9.0