getTeleconsultationOrderData method

dynamic getTeleconsultationOrderData(
  1. dynamic currentPage
)

Implementation

getTeleconsultationOrderData(currentPage) async {
  var decodedResponse;

  try {
    final response = await http.get(
      Uri.parse(
          '${WELLNESS_URL}api/teleconsultation/consultations?page=$currentPage'),
      headers: {'Authorization': currentUserToken},
    );

    decodedResponse = json.decode(response.body);

    if (decodedResponse['success'] == true) {
      total_pages = decodedResponse['total_pages'];
      getTeleconsultationOrderList.addAll(await decodedResponse['data']);
    } else {
      Get.back();
    }
  } catch (e) {
    ErrorListner(
        apiname: 'api/teleconsultation/consultationst',
        responsed: "${decodedResponse}",
        request: "",
        app_error: '${e}');
  }
}