BookDoctorPlaceorder method
Future
BookDoctorPlaceorder({
- dynamic doctorId,
- dynamic hospitalId,
- dynamic fullname,
- dynamic mobilenumber,
- dynamic emailid,
- dynamic price,
- dynamic slotdate,
- dynamic slottime,
- dynamic inserid,
Implementation
Future BookDoctorPlaceorder(
{doctorId,
hospitalId,
fullname,
mobilenumber,
emailid,
price,
slotdate,
slottime,
inserid}) async {
final ApiBody = {
"doctor_id": doctorId,
"hospital_id": hospitalId,
"fullname": fullname,
"mobileno": mobilenumber,
"email_id": emailid,
"price": price,
"slot_date": slotdate,
"slot_time": slottime,
"insert_id": inserid
};
var decodedResponse;
try {
Map data = ApiBody;
var body = jsonEncode(data);
final response = await http.post(
Uri.parse('${SDK_BASE_URL}doctor_api/place_order'),
headers: {'Authorization': SignUpController.currentUserToken},
body: body,
);
decodedResponse = json.decode(response.body);
Get.to(PaymentPopup(
fromplace: 'doctor',
messag: '${decodedResponse['results']['message']}',
image: '${LottiePath}Upload_Successful.json',
));
} catch (e) {
errorListner(
apiname: 'doctor_api/place_order',
responsed: "${decodedResponse}",
request: '${ApiBody}',
app_error: '${e}');
}
}