merge
This commit is contained in:
parent
9c83ab630d
commit
cf5107f764
@ -257,7 +257,6 @@ class _LoginScreenState extends ConsumerState<LoginScreen> {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Future<void> verifyMobileOrMailOTP(otpVerifyStatus) async {
|
||||
try {
|
||||
// Select API endpoint
|
||||
@ -304,10 +303,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen> {
|
||||
print('userRole -- $userRole');
|
||||
context.go(AppRoutes.dashboard);
|
||||
} else {
|
||||
ToastHelper.showErrorToast(
|
||||
context,
|
||||
data['message'] ?? 'Invalid OTP',
|
||||
);
|
||||
ToastHelper.showErrorToast(context, data['message'] ?? 'Invalid OTP');
|
||||
}
|
||||
} else {
|
||||
ToastHelper.showErrorToast(
|
||||
@ -926,7 +922,9 @@ class _LoginScreenState extends ConsumerState<LoginScreen> {
|
||||
clickedButtonName = 'agent';
|
||||
});
|
||||
// ⏳ Wait for API to finish
|
||||
final success = await sendMobileOrEmailVerify('agent');
|
||||
final success = await sendMobileOrEmailVerify(
|
||||
'agent',
|
||||
);
|
||||
|
||||
if (success) {
|
||||
// API success → loader stops immediately
|
||||
@ -988,12 +986,13 @@ class _LoginScreenState extends ConsumerState<LoginScreen> {
|
||||
text: "Login as Staff",
|
||||
backgroundColor: Color(0xFF436462),
|
||||
onPressed: () async {
|
||||
|
||||
setState(() {
|
||||
clickedButtonName = 'staff';
|
||||
});
|
||||
// ⏳ Wait for API to finish
|
||||
final success = await sendMobileOrEmailVerify('staff');
|
||||
final success = await sendMobileOrEmailVerify(
|
||||
'staff',
|
||||
);
|
||||
|
||||
if (success) {
|
||||
// API success → loader stops immediately
|
||||
@ -1120,7 +1119,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen> {
|
||||
// ],
|
||||
AnimatedSwitcher(
|
||||
duration: const Duration(
|
||||
milliseconds: 500,
|
||||
milliseconds: 500,
|
||||
), // animation speed
|
||||
switchInCurve: Curves.easeInOutCirc,
|
||||
switchOutCurve: Curves.easeOutCirc,
|
||||
@ -1201,7 +1200,9 @@ class _LoginScreenState extends ConsumerState<LoginScreen> {
|
||||
if (switcherStatus == 1) {
|
||||
await verifyFirebaseMobileOTP();
|
||||
} else {
|
||||
await verifyMobileOrMailOTP(_otpController.text);
|
||||
await verifyMobileOrMailOTP(
|
||||
_otpController.text,
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user