FindDoctor method
Future
FindDoctor({
- dynamic doctorname,
- dynamic departmentName,
- dynamic location,
- dynamic pincode,
- dynamic mobilenumber,
Implementation
Future FindDoctor(
{doctorname, departmentName, location, pincode, mobilenumber}) async {
final ApiBody = {
"name": doctorname,
"department_name": departmentName,
"location": location,
"pincode": pincode.toString(),
"type": "doctor",
"mobile_no": mobilenumber.toString(),
};
var decodedResponse;
try {
final response = await http.post(
Uri.parse('${SDK_BASE_URL}api/home_index/couldnt_find'),
body: ApiBody,
headers: {
"Authorization": SignUpController.currentUserToken,
});
decodedResponse = json.decode(response.body);
if (response.statusCode == 200) {
Get.back();
Get.snackbar(
"Your Appointment Request Successfully Sent.",
" Our executive team will contact you within 30 minutes for further coordination",
);
}
} catch (e) {
ErrorListner(
apiname: 'api/doctors/couldnt_find',
responsed: "${decodedResponse}",
request: '${ApiBody}',
app_error: '${e}');
}
}