deleteMedicineAddressData method

Future deleteMedicineAddressData({
  1. dynamic address_id,
  2. dynamic context,
})

Implementation

Future deleteMedicineAddressData({address_id, context}) async {
  var decodedResponse;
  final ApiBody = {"address_id": '$address_id'};
  var body = jsonEncode(ApiBody);

  http.Response response = await http.post(
      Uri.parse('${WELLNESS_URL}api/medicine/delete-user-address'),
      headers: {
        "Content-Type": "application/json",
        'Authorization': currentUserToken,
      },
      body: body);
  decodedResponse = json.decode(response.body);
  Get.back();
  if (decodedResponse['success'] == true) {
    Validator().successMessage(
        context: context, message: "${decodedResponse['message']}");
  } else {
    Validator().errorMessage(
        context: context, message: "${decodedResponse['message']}");
  }
}