prescriptionList method

Future prescriptionList()

Implementation

Future prescriptionList() async {
  var decodedResponse;
  UploadedPrescriptionList.clear();

  try {
    final response = await http.get(
      Uri.parse('${WELLNESS_URL}api/diagnostic/uploaded-prescriptions-list'),
      headers: {'Authorization': currentUserToken},
    );
    decodedResponse = json.decode(response.body);
    if (decodedResponse['success'] == true) {
      UploadedPrescriptionList = await decodedResponse['data'];
    } else {
      Get.back();
    }
  } catch (e) {
    ErrorListner(
        apiname: 'api/diagnostic/uploaded-prescriptions-list',
        responsed: "${decodedResponse}",
        request: "",
        app_error: '${e}');
  }
}