requestWithLatLng static method

Future<Map<String, dynamic>> requestWithLatLng({
  1. required double latitude,
  2. required double longitude,
})

Implementation

static Future<Map<String, dynamic>> requestWithLatLng(
    {required double latitude, required double longitude}) async {
  http.Response? response = await post(
      client: http.Client(),
      url:
          "${Config.url}&lat=$latitude&lon=$longitude&zoom=18&addressdetails=1");
  return response != null
      ? jsonDecode(utf8.decode(response.bodyBytes)) as Map<String, dynamic>
      : <String, dynamic>{};
}