CorporateHealthcareEmailVerify method

Future CorporateHealthcareEmailVerify({
  1. dynamic context,
  2. dynamic email,
  3. dynamic mobile,
  4. dynamic verifyFor,
})

Implementation

Future CorporateHealthcareEmailVerify(
    {context, email, mobile, verifyFor}) async {
  final response = await http.post(
    Uri.parse(
        '${SDK_BASE_URL}claim_adminpanel/claim_api/package_registration/verify_email'),
    body: {
      "email_id": '${email}',
      "txt_opt_sent_no": '${mobile}',
      "verify_for": '${verifyFor}'
    },
  );
  print(response.body);
  var decodedResponse = json.decode(response.body);
  if (decodedResponse['email_verified'] == 'notfound') {
    Get.back();
    ScaffoldMessenger.of(context).showSnackBar(SnackBar(
        content: Text(
          "${decodedResponse['message']}".trim(),
          style: TextStyle(
              fontFamily: 'Nunito',
              fontWeight: FontWeight.w500,
              fontSize: 14),
        ),
        behavior: SnackBarBehavior.floating));
  } else {
    Get.back();

    Get.to(Corporate_healthCare_verifyotp(
      email: email,
      emailverify: '${decodedResponse['email_verified']}',
      mobNum: mobile,
    ));
    ScaffoldMessenger.of(context).showSnackBar(SnackBar(
        content: Text(
          "${decodedResponse['message']}".trim(),
          style: TextStyle(
              fontFamily: 'Nunito',
              fontWeight: FontWeight.w500,
              fontSize: 14),
        ),
        behavior: SnackBarBehavior.floating));
    await CorporateHealthcareSendOTP(
        context: context,
        email: email,
        email_verified: '${decodedResponse['email_verified']}',
        mobile: mobile);
  }
}