deleteAddressData method
Future
deleteAddressData(
{ - dynamic address_id,
- dynamic context,
})
Implementation
Future deleteAddressData({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/diagnostic/delete-user-address'),
headers: {
"Content-Type": "application/json",
'Authorization': currentUserToken,
},
body: body);
decodedResponse = json.decode(response.body);
if (decodedResponse['success'] == true) {
Validator().successMessage(
context: context, message: "${decodedResponse['message']}");
} else {
Validator().errorMessage(
context: context, message: "${decodedResponse['message']}");
}
}