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