BookAppointment method
Future
BookAppointment({
- dynamic bookid,
- dynamic deptid,
- dynamic mbprice,
- dynamic type,
- dynamic userid,
- dynamic patientname,
- dynamic patientage,
- dynamic appointmentdate,
- dynamic gender,
- dynamic mobilenumber,
- dynamic emailid,
- dynamic checkbox,
- dynamic appointment_time,
Implementation
Future BookAppointment(
{bookid,
deptid,
mbprice,
type,
userid,
patientname,
patientage,
appointmentdate,
gender,
mobilenumber,
emailid,
checkbox,
appointment_time}) async {
final ApiBody = {
"otp_verify": "1",
"bookid": "${bookid}",
"dept_id": "${deptid}",
"mb_price": "${mbprice}",
"mb_consult_type": type,
"user_id": "${userid}",
"patient_name": patientname,
"patient_age": "${patientage}",
"appointment_date": appointmentdate,
"appointment_time": appointment_time == null ? "" : appointment_time,
"gender": gender,
"mobile_number": "${mobilenumber}",
"email_id": emailid,
"check_use_wallet": "${checkbox}",
};
var decodedResponse;
try {
final response = await http.post(
Uri.parse('${SDK_BASE_URL}teleconsultation_api/book'),
body: ApiBody,
headers: {
"Authorization": SignUpController.currentUserToken,
});
decodedResponse = json.decode(response.body);
Get.back();
if (response.statusCode == 200) {
Get.back();
}
return decodedResponse;
} catch (e) {
errorListner(
apiname: 'teleconsultation_api/book',
responsed: "${decodedResponse}",
request: "${ApiBody}",
app_error: '${e}');
}
}