teleconsultationRescheduleOrder method
dynamic
teleconsultationRescheduleOrder({
- dynamic orderId,
- dynamic appointmentDate,
- dynamic appointmentTime,
- dynamic context,
Implementation
teleconsultationRescheduleOrder(
{orderId, appointmentDate, appointmentTime, context}) async {
var decodedResponse;
final ApiBody = {
"appointment_date": '$appointmentDate',
"appointment_time": '$appointmentTime',
"is_reshduled": '1',
};
http.Response response = await http.post(
Uri.parse(
'${WELLNESS_URL}api/teleconsultation/consultations/edit/$orderId'),
headers: {
'Authorization': currentUserToken,
},
body: ApiBody);
decodedResponse = json.decode(response.body);
Get.back();
if (decodedResponse['success'] == true) {
showDialog(
context: context,
barrierDismissible: false,
builder: (BuildContext context) {
return MedicinePaymentSuccessPopup(
fromPage: 'cancel_medicine',
message: "${decodedResponse['message']}",
image: "${FolderPath}Cancel_Order_Icon.svg",
ontap: () {
Get.off(MyOrders(
fromScreen: 'teleconsultation',
));
Get.to(TeleconsultationOrderDetails(Order_Id: "${orderId}"),
transition: Transition.noTransition,
preventDuplicates: false);
},
);
});
} else {
Validator().errorMessage(
context: context, message: "${decodedResponse['message']}");
}
}