getSplitMedicineDetailsData method

dynamic getSplitMedicineDetailsData({
  1. dynamic medicine_order_id,
  2. dynamic context,
})

Implementation

getSplitMedicineDetailsData({medicine_order_id, context}) async {
  final response = await http.get(
    Uri.parse(
        '${WELLNESS_URL}api/medicine/order-history?order_id=$medicine_order_id'),
    headers: {'Authorization': currentUserToken},
  );

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

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