callDoctorForPrescription method
Future
callDoctorForPrescription({
- dynamic name,
- dynamic mobile_number,
- dynamic email_address,
- dynamic remark,
- dynamic context,
Implementation
Future callDoctorForPrescription(
{name, mobile_number, email_address, remark, context}) async {
var decodedResponse;
final ApiBody = {
"name": "$name",
"mobile_no": "$mobile_number",
"email_id": "$email_address",
"remark": "$remark"
};
var body = jsonEncode(ApiBody);
http.Response response = await http.post(
Uri.parse('${WELLNESS_URL}api/medicine/call-doctor-request'),
headers: {
"Content-Type": "application/json",
'Authorization': currentUserToken,
},
body: body);
decodedResponse = json.decode(response.body);
Get.back();
if (decodedResponse['success'] == true) {
Get.off(MedicineHome());
await showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return PinCodePopUp(
messag: "${decodedResponse['message']}",
image: '${LottiePath}Upload_Successful.json',
);
},
);
} else {
Validator().errorMessage(
context: context, message: "${decodedResponse['message']}");
}
}