SelectTime method
dynamic
SelectTime({
- dynamic hospitalId,
- dynamic doctorId,
- dynamic day,
- dynamic date,
Implementation
SelectTime({hospitalId, doctorId, day, date}) async {
var decodedResponse;
final ApiBody = {
"doctor_id": doctorId.toString(),
"hospital_id": hospitalId.toString(),
"day": day,
"date": date.toString(),
};
try {
http.Response response = await http.post(
Uri.parse('${SDK_BASE_URL}doctor_api/appointment_timeslot'),
headers: {
"Authorization": SignUpController.currentUserToken,
},
body: ApiBody);
decodedResponse = json.decode(response.body);
morningtime = decodedResponse['details']['monring'];
afternoontime = decodedResponse['details']['afternoon'];
eveningtime = decodedResponse['details']['evening'];
timelist = morningtime + afternoontime + eveningtime;
return timelist;
} catch (e) {
errorListner(
apiname: 'doctor_api/appointment_timeslot',
responsed: "${decodedResponse}",
request: '${ApiBody}',
app_error: '${e}');
}
}