Open kadnan0900 opened 4 years ago
@humazed please guide how i can get city and address?
Hi,
If your G-Map API Key is generated from billing account , then just use result.address to get the address and index it orderly to meet your requirement.
If you're using a free API Key, you need to use a package https://pub.dev/packages/geolocator , as the google_map_location_picker will give you latlong only. Below is the code you can refer,
`import 'package:geolocator/geolocator.dart';
LocationResult result = await showLocationPicker(
context,
AppStrings.API_KEY,
automaticallyAnimateToCurrentLocation: true,
myLocationButtonEnabled: true,
layersButtonEnabled: true,
resultCardAlignment: Alignment.bottomCenter,
);
final Geolocator geolocator = Geolocator()..forceAndroidLocationManager;
List
}`
LocationResult result = await showLocationPicker( context, AppStrings.API_KEY, automaticallyAnimateToCurrentLocation: true, myLocationButtonEnabled: true, layersButtonEnabled: true, resultCardAlignment: Alignment.bottomCenter, );
How we can get area and city from result?