getTimeSlot method

dynamic getTimeSlot({
  1. dynamic departmentId,
  2. dynamic date,
})

Implementation

getTimeSlot({departmentId, date}) async {
  final ApiBody = {"department_id": '$departmentId', 'date': '$date'};
  final response = await http.post(
      Uri.parse('${medicine_API}api/teleconsultation/department-time-slot'),
      body: ApiBody,
      headers: {
        "Authorization": currentUserToken,
      });

  var decodedResponse = json.decode(response.body);
  getTimeSlotData = await decodedResponse['data']['time_slots'];
}