AreaWiseList method

Future AreaWiseList({
  1. dynamic name,
})

Implementation

Future AreaWiseList({name}) async {
  var decodedResponse;
  final ApiBody = {
    "city_name": name,
  };
  try {
    final response = await http.post(
        Uri.parse('${SDK_BASE_URL}dental_api/get_city'),
        body: ApiBody,
        headers: {"Authorization": SignUpController.currentUserToken});
    decodedResponse = json.decode(response.body);

    areaList = decodedResponse['areas'];
  } catch (e) {
    errorListner(
        apiname: 'dental_api/get_city',
        responsed: "${decodedResponse}",
        request: '${ApiBody}',
        app_error: '${e}');
  }
}