getPkgDetails method

Future getPkgDetails({
  1. dynamic id,
})

Implementation

Future getPkgDetails({id}) async {
  var decodedResponse;
  try {
    final response = await http.get(
      Uri.parse('${medicine_API}api/diagnostic/get-packages/${id}'),
      headers: {'Authorization': currentUserToken},
    );
    decodedResponse = json.decode(response.body);
    PkgDetails = await decodedResponse['data'][0];
  } catch (e) {
    ErrorListner(
        apiname: 'api/diagnostic/get-packages/${id}',
        responsed: "${decodedResponse}",
        request: "",
        app_error: '${e}');
  }
}