medicalloanfunction method
Future
medicalloanfunction({
- dynamic name,
- dynamic mobile,
- dynamic email,
- dynamic gender,
- dynamic pancard,
- dynamic addharcard,
- dynamic credithistory,
- dynamic procedure,
- dynamic date,
- dynamic loanamt,
- dynamic city,
- dynamic hospitalname,
Implementation
Future medicalloanfunction({
name,
mobile,
email,
gender,
pancard,
addharcard,
credithistory,
procedure,
date,
loanamt,
city,
hospitalname,
}) async {
final ApiBody = {
"fullname": name,
"mobile": mobile,
"email": email,
"gender": gender,
"pancard_no": "${pancard}",
"aadhar_number": "${addharcard}",
"credit_history": "${credithistory}",
"procedure": "${procedure}",
"date_of_hospitalization": "${date}",
"loan_amt": "${loanamt}",
"city": "${city}",
"hospital_name": "${hospitalname}",
};
var decodedResponse;
try {
final response = await http.post(
Uri.parse(
'${SDK_BASE_URL}claim_adminpanel/claim_api/medical_loan_request'),
body: ApiBody,
headers: {
"Authorization": SignUpController.currentUserToken,
});
decodedResponse = json.decode(response.body);
if (decodedResponse['status'] == true) {
Get.off(HomePage(), transition: Transition.fadeIn);
Get.snackbar(
"Loan request generated successfully.",
"${decodedResponse['message']}",
);
} else {
Get.snackbar("Something Went Wrong", "${decodedResponse['message']}");
}
} catch (e) {
errorListner(
apiname: 'claim_adminpanel/claim_api/medical_loan_request',
responsed: "${decodedResponse}",
request: "${ApiBody}",
app_error: '${e}');
}
}