getSingleMedicineDetailsData method

dynamic getSingleMedicineDetailsData({
  1. dynamic medicine_order_id,
  2. dynamic onemg_order_id,
  3. dynamic context,
})

Implementation

getSingleMedicineDetailsData(
    {medicine_order_id, onemg_order_id, context}) async {
  final response = await http.get(
    Uri.parse(
        '${medicine_API}api/medicine/order-details/?medicine_order_id=$medicine_order_id&onemg_order_id=$onemg_order_id'),
    headers: {'Authorization': currentUserToken},
  );

  var decodedResponse = json.decode(response.body);

  if (decodedResponse['success'] == true) {
    getSingleMedicineDetails = decodedResponse['data'];
    cancelReasonList = decodedResponse['cancellation_reason_list'];
  } else {
    Validator().errorMessage(
        context: context, message: "${decodedResponse['message']}");
  }
}