WellnessSupportRequest method

dynamic WellnessSupportRequest({
  1. dynamic usermobnum,
  2. dynamic requestType,
  3. dynamic name,
  4. dynamic mobile,
  5. dynamic email,
  6. dynamic message,
  7. dynamic context,
})

Implementation

WellnessSupportRequest(
    {usermobnum, requestType, name, mobile, email, message, context}) async {
  var decodedResponse;
  final apibody = {
    "support_request_no": usermobnum.toString(),
    "support_request_type": requestType.toString(),
    "name": name.toString(),
    "mobile": mobile.toString(),
    "email": email.toString(),
    "message": message.toString(),
  };
  try {
    http.Response response = await http.post(
        Uri.parse('${SDK_BASE_URL}wellness_api/request_support'),
        body: apibody);
    decodedResponse = json.decode(response.body);

    if (decodedResponse['status'] == 200) {
      Get.offAll(HomePage());
      showDialog(
          context: context,
          barrierDismissible: false,
          builder: (BuildContext context) {
            return PinCodePopUp(
              messag: "${decodedResponse['message']}",
              image: '${LottiePath}Upload_Successful.json',
            );
          });
    }
  } catch (e) {
    errorListner(
        apiname: 'wellness_api/request_support',
        responsed: "${decodedResponse}",
        request: '${apibody}',
        app_error: '${e}');
  }
}