DepartmentSearchDoctor method

dynamic DepartmentSearchDoctor({
  1. dynamic departmentId,
})

Implementation

DepartmentSearchDoctor({departmentId}) async {
  var decodedResponse;
  final ApiBody = {"txt_department": departmentId.toString()};
  try {
    http.Response response =
        await http.post(Uri.parse('${SDK_BASE_URL}doctor_api/near_me'),
            headers: {
              "Authorization": SignUpController.currentUserToken,
            },
            body: ApiBody);
    decodedResponse = json.decode(response.body);
    DepartmentDoctorList = decodedResponse['near_by'];
  } catch (e) {
    errorListner(
        apiname: 'doctor_api/near_me',
        responsed: "${decodedResponse}",
        request: '${ApiBody}',
        app_error: '${e}');
  }
}