curtain and forget password and select all check box and fix bugs

This commit is contained in:
mohammad
2024-09-08 17:09:32 +03:00
parent 67ea7af595
commit 85a04e504f
16 changed files with 708 additions and 352 deletions

View File

@ -29,40 +29,13 @@ class AuthenticationAPI {
}
static Future<int?> sendOtp({required String email, required String regionUuid}) async {
try {
final response = await HTTPService().post(
path: ApiEndpoints.sendOtp,
body: {"email": email, "type": "PASSWORD", "regionUuid": regionUuid},
showServerMessage: true,
expectedResponseModel: (json) {
return json['data']['cooldown'];
});
return response;
} on DioException catch (e) {
final errorData = e.response!.data;
String errorMessage = errorData['message'];
print('sendOtp=$errorMessage');
if (e.response != null) {
if (e.response!.statusCode == 400) {
final errorData = e.response!.data;
String errorMessage = errorData['message'];
print('sendOtp=$errorMessage');
if (errorMessage == 'User not found') {
return 1;
} else {
int cooldown = errorData['data']['cooldown'] ?? 1;
return cooldown;
}
} else {
return 1;
}
} else {
return 1;
}
} catch (e) {
return 1;
}
final response = await HTTPService().post(
path: ApiEndpoints.sendOtp,
body: {"email": email, "type": "PASSWORD", "regionUuid": regionUuid},
showServerMessage: true,
expectedResponseModel: (json) {
return json['data']['cooldown'];
});
}
static Future verifyOtp({required String email, required String otpCode}) async {