getTeleconsultationOrderDetails method

dynamic getTeleconsultationOrderDetails(
  1. dynamic orderId
)

Implementation

getTeleconsultationOrderDetails(orderId) async {
  teleconsultationOrderDetails = null;
  var decodedResponse;
  var url =
      '${WELLNESS_URL}api/teleconsultation/get-consultation-details/$orderId';
  try {
    http.Response response = await http.get(
      Uri.parse('${url}'),
      headers: {
        "Authorization": currentUserToken,
      },
    );

    decodedResponse = json.decode(response.body);
    if (decodedResponse['success'] == true) {
      teleconsultationOrderDetails = decodedResponse;
      cancelReasonList = decodedResponse['cancellation_reason_list'];
    } else {
      Navigator.popAndPushNamed(commonContext, '/wellnesspage');
    }
  } catch (e) {
    ErrorListner(
        apiname: '$url',
        responsed: "${decodedResponse}",
        request: '',
        app_error: '${e}');
  }
}