otpVerify static method
Future<bool>
otpVerify(
- dynamic otp,
- dynamic token
)
Implementation
static Future<bool> otpVerify(otp, token) async {
Response response;
final dio = apiClient();
try {
var data = dio.then((value) async {
response = await value
.post("submit/idChecks/verifyOtp", data: {"otp": otp});
// response = await dio.post("${baseUrl1}submit/idChecks/verifyOtp", data: {"otp": otp});
// print("otpVerify response =${response}");
if (response.statusCode == 200) {
return true;
} else {
throw Exception("Invalid OTP");
}
});
return data;
} catch (e) {
//print("e =${e.toString()}");
throw Exception("Something went wrong, try again");
}
}