BASE: Switch From EasyLocalization To GetX Localization.

This commit is contained in:
2025-12-04 16:56:39 +05:00
parent 157545f1c0
commit bf1d07a048
218 changed files with 2535 additions and 2313 deletions

View File

@@ -1,9 +1,10 @@
import 'package:customer/screen_ui/location_enable_screens/location_permission_screen.dart';
import 'package:customer/themes/show_toast_dialog.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:customer/utils/app_router.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart' hide Trans;
import 'package:get/get.dart';
import '../constant/constant.dart';
import '../models/user_model.dart';
import '../screen_ui/auth_screens/login_screen.dart';
@@ -43,7 +44,7 @@ class OtpVerifyController extends GetxController {
codeSent: (String verificationId0, int? resendToken0) async {
verificationId.value = verificationId0;
resendToken.value = resendToken0!;
ShowToastDialog.showToast("OTP sent".tr());
ShowToastDialog.showToast("OTP sent".tr);
},
timeout: const Duration(seconds: 25),
forceResendingToken: resendToken.value,
@@ -56,12 +57,12 @@ class OtpVerifyController extends GetxController {
void verifyOtp() async {
if (otpController.value.text.length != 6) {
ShowToastDialog.showToast("Enter valid 6-digit OTP".tr());
ShowToastDialog.showToast("Enter valid 6-digit OTP".tr);
return;
}
try {
ShowToastDialog.showLoader("Verifying OTP...".tr());
ShowToastDialog.showLoader("Verifying OTP...".tr);
final credential = PhoneAuthProvider.credential(
verificationId: verificationId.value,
@@ -107,14 +108,14 @@ class OtpVerifyController extends GetxController {
final userModel = await FireStoreUtils.getUserProfile(result.user!.uid);
if (userModel == null || userModel.role != 'customer') {
await _auth.signOut();
Get.offAll(() => const LoginScreen());
Get.offAll(LoginScreen());
return;
}
if (userModel.active == false) {
ShowToastDialog.showToast("This user is disabled".tr());
ShowToastDialog.showToast("This user is disabled".tr);
await _auth.signOut();
Get.offAll(() => const LoginScreen());
Get.offAll(LoginScreen());
return;
}
@@ -128,13 +129,13 @@ class OtpVerifyController extends GetxController {
);
Constant.selectedLocation = defaultAddress;
Get.offAll(() => const ServiceListScreen());
Get.offAll(ServiceListScreen());
} else {
Get.offAll(() => const LocationPermissionScreen());
Get.offAll(LocationPermissionScreen());
}
} catch (e) {
ShowToastDialog.closeLoader();
ShowToastDialog.showToast("Invalid OTP or Verification Failed".tr());
ShowToastDialog.showToast("Invalid OTP or Verification Failed".tr);
}
}