CorporateHealthcareVerifyOTP method
Future
CorporateHealthcareVerifyOTP({
- dynamic context,
- dynamic otp,
- dynamic email,
- dynamic mobile,
- dynamic emailverify,
- dynamic fcmkey,
- dynamic deviceid,
Implementation
Future CorporateHealthcareVerifyOTP(
{context, otp, email, mobile, emailverify, fcmkey, deviceid}) async {
final response = await http.post(
Uri.parse(
'${SDK_BASE_URL}claim_adminpanel/claim_api/package_registration/otp_verify'),
body: {
"txt_opt": '${otp}',
"email": '${email}',
"txt_opt_sent_no": '${mobile}',
"email_verified": '${emailverify}',
"fcmkey": '${fcmkey}',
"source": Platform.isAndroid ? 1.toString() : 2.toString(),
"device_id": '${deviceid}'
},
);
var decodedResponse = json.decode(response.body);
if (decodedResponse['status'] == true) {
SharedPreferences _prefs = await SharedPreferences.getInstance();
_prefs.setString('currentUserToken', decodedResponse['access_token']);
currentUserToken = _prefs.getString('currentUserToken');
Get.offAll(HomePage());
} else {
Fluttertoast.showToast(
msg: "${decodedResponse['message']}",
fontSize: 11.sp,
gravity: ToastGravity.CENTER,
toastLength: Toast.LENGTH_SHORT);
}
}