BASE: Switch From EasyLocalization To GetX Localization.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import 'package:customer/themes/show_toast_dialog.dart';
|
||||
import 'package:easy_localization/easy_localization.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 '../screen_ui/auth_screens/otp_verification_screen.dart';
|
||||
|
||||
@@ -21,13 +21,13 @@ class MobileLoginController extends GetxController {
|
||||
|
||||
if (mobile.isEmpty || mobile.length != 10) {
|
||||
ShowToastDialog.showToast(
|
||||
"Please enter a valid 10-digit mobile number".tr(),
|
||||
"Please enter a valid 10-digit mobile number".tr,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
ShowToastDialog.showLoader("Sending OTP...".tr());
|
||||
ShowToastDialog.showLoader("Sending OTP...".tr);
|
||||
|
||||
await _auth.verifyPhoneNumber(
|
||||
phoneNumber: '$countryCode$mobile',
|
||||
@@ -37,10 +37,10 @@ class MobileLoginController extends GetxController {
|
||||
verificationFailed: (FirebaseAuthException e) {
|
||||
ShowToastDialog.closeLoader();
|
||||
if (e.code == 'invalid-phone-number') {
|
||||
ShowToastDialog.showToast("Invalid phone number".tr());
|
||||
ShowToastDialog.showToast("Invalid phone number".tr);
|
||||
} else {
|
||||
ShowToastDialog.showToast(
|
||||
e.message ?? "OTP verification failed".tr(),
|
||||
e.message ?? "OTP verification failed".tr,
|
||||
);
|
||||
}
|
||||
},
|
||||
@@ -57,13 +57,13 @@ class MobileLoginController extends GetxController {
|
||||
},
|
||||
codeAutoRetrievalTimeout: (String verificationId) {
|
||||
ShowToastDialog.closeLoader();
|
||||
ShowToastDialog.showToast("OTP timed out. Please try again.".tr());
|
||||
ShowToastDialog.showToast("OTP timed out. Please try again.".tr);
|
||||
// Optional: Handle timeout
|
||||
},
|
||||
);
|
||||
} catch (e) {
|
||||
ShowToastDialog.closeLoader();
|
||||
ShowToastDialog.showToast("Something went wrong. Please try again.".tr());
|
||||
ShowToastDialog.showToast("Something went wrong. Please try again.".tr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user