BASE: Initialize Localization.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:firebase_auth/firebase_auth.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -11,17 +12,17 @@ class ForgotPasswordController extends GetxController {
|
||||
final email = emailEditingController.value.text.trim();
|
||||
|
||||
if (email.isEmpty) {
|
||||
ShowToastDialog.showToast("Please enter your email address.".tr);
|
||||
ShowToastDialog.showToast("Please enter your email address.".tr());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!GetUtils.isEmail(email)) {
|
||||
ShowToastDialog.showToast("Please enter a valid email address.".tr);
|
||||
ShowToastDialog.showToast("Please enter a valid email address.".tr());
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
ShowToastDialog.showLoader("Please wait...".tr);
|
||||
ShowToastDialog.showLoader("Please wait...".tr());
|
||||
await FirebaseAuth.instance.sendPasswordResetEmail(email: email);
|
||||
ShowToastDialog.closeLoader();
|
||||
ShowToastDialog.showToast(
|
||||
@@ -31,9 +32,9 @@ class ForgotPasswordController extends GetxController {
|
||||
} on FirebaseAuthException catch (e) {
|
||||
ShowToastDialog.closeLoader();
|
||||
if (e.code == 'user-not-found') {
|
||||
ShowToastDialog.showToast('No user found for that email.'.tr);
|
||||
ShowToastDialog.showToast('No user found for that email.'.tr());
|
||||
} else {
|
||||
ShowToastDialog.showToast(e.message?.tr ?? "something_went_wrong".tr);
|
||||
ShowToastDialog.showToast(e.message?.tr() ?? "something_went_wrong".tr());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user