getPredictSpecialty method

Future<List<PredictSpecialty>> getPredictSpecialty(
  1. int consultationID
)

Implementation

Future<List<PredictSpecialty>> getPredictSpecialty(int consultationID) async {
  final response = await callApi(
      endpoint: 'consultations/$consultationID/predict-specialty',
      method: 'get');
  if (response.statusCode == 200) {
    final List<dynamic> responseData = json.decode(response.body);
    final List<PredictSpecialty> predictSpecialty =
    responseData.map((json) => PredictSpecialty.fromJson(json)).toList();
    return predictSpecialty;
  } else {
    throw Exception(response);
  }
}