IntimateMyClaimFunction method
dynamic
IntimateMyClaimFunction({
- dynamic patientname,
- dynamic reasonforclaim,
- dynamic nameofhospital,
- dynamic pinocde,
- dynamic city,
- dynamic state,
- dynamic remarks,
- dynamic selectedDate,
- dynamic fileupload,
- dynamic hospitaladdress,
Implementation
IntimateMyClaimFunction(
{patientname,
reasonforclaim,
nameofhospital,
pinocde,
city,
state,
remarks,
selectedDate,
fileupload,
hospitaladdress}) async {
var request = http.MultipartRequest('POST',
Uri.parse('${SDK_BASE_URL}claim_adminpanel/claim_api/intimate_claim'));
request.headers
.addAll({"Authorization": "${SignUpController.currentUserToken}"});
request.fields['type'] = '3';
request.fields['policy_no'] =
policyList[indexvalue]['policy_no'].toString();
request.fields['patientname'] = "${patientname}";
request.fields['dateofhospitalization'] = '${selectedDate}';
request.fields['hospitalname'] = nameofhospital;
request.fields['causeofhospitalization'] = reasonforclaim;
request.fields['type_claim'] = 'seft intimate';
request.fields['hospitaladdress'] = hospitaladdress;
request.fields['pincode'] = pinocde.toString();
request.fields['city'] = city;
request.fields['state'] = state;
request.fields['remarks'] = remarks;
request.files.add(
await http.MultipartFile.fromPath("policy_files[]", "${fileupload}"));
var response = await request.send();
var responsed = await http.Response.fromStream(response);
var decodedResponse = json.decode(responsed.body);
if (decodedResponse['status'] == true) {
Get.back();
Get.to(HomePage());
Fluttertoast.showToast(msg: '${decodedResponse['message']}');
} else {
Fluttertoast.showToast(msg: '${decodedResponse['message']}');
}
}