DoctorProfileFunction method

dynamic DoctorProfileFunction({
  1. dynamic doctorId,
  2. dynamic doctorName,
})

Implementation

DoctorProfileFunction({doctorId, doctorName}) async {
  var decodedResponse;
  final ApiBody = {
    "doctor_id": doctorId.toString(),
    "doctor_name": doctorName,
  };
  try {
    http.Response response =
        await http.post(Uri.parse('${SDK_BASE_URL}doctor_api/profile'),
            headers: {
              "Authorization": SignUpController.currentUserToken,
            },
            body: ApiBody);
    decodedResponse = json.decode(response.body);
    doctorInfo.value = decodedResponse['doctor_info'];
    experience = decodedResponse['experience'];
    achievements = decodedResponse['achievements'];
    relateddoctors = decodedResponse['near_by'];
  } catch (e) {
    errorListner(
        apiname: 'doctor_api/profile',
        responsed: "${decodedResponse}",
        request: '${ApiBody}',
        app_error: '${e}');
  }
}