address method

Future<Address> address({
  1. required double latitude,
  2. required double longitude,
})

Implementation

Future<Address> address(
    {required double latitude, required double longitude}) async {
  final data = await _apiRequest('geocode/json',
      queryParameters: {'latlng': '$latitude,$longitude'});
  final results = data['results'] as Iterable;
  final location = results.elementAt(0);
  return Address.fromJson(location);
}