resendOTPAPI method

Future<void> resendOTPAPI(
  1. BuildContext context,
  2. String mobileNumber
)

Implementation

Future<void> resendOTPAPI(BuildContext context,
    String mobileNumber) async{
  var auth = authrepository();
  Map<String, dynamic> requestBody = {
    "Statement": "ResendOTP",
    "OTP_RefID": kglobal.shared.OTPRefID,
    "MobileNumber": mobileNumber,
    "DeviceID": kglobal.shared.deviceID,
    "GeoLocation": kglobal.shared.geolocation

  };

  String bodyJson = jsonEncode(requestBody);

  auth.ResendOtp(context, bodyJson).then((value) {
    if (value.responseCode.length == 4) {
      kglobal.shared.OTPRefID = value.otpRefId;
      kglobal.shared.showSnack(context,false, 'OTP ${value.message}');


    } else {
      kglobal.shared.showSnack(context,true,value.message);

    }
  });
}