getMedicineAddressList method

Future getMedicineAddressList()

Implementation

Future getMedicineAddressList() async {
  var decodedResponse;

  try {
    final response = await http.get(
      Uri.parse('${WELLNESS_URL}api/medicine/user-address-list'),
      headers: {'Authorization': currentUserToken},
    );

    decodedResponse = json.decode(response.body);

    if (decodedResponse['success'] == true) {
      getMedicineAddressData = decodedResponse['data'];
    } else {
      Get.back();
    }
  } catch (e) {
    ErrorListner(
        apiname: 'api/medicine/user-address-list',
        responsed: "${decodedResponse}",
        request: "",
        app_error: '${e}');
  }
}