I'm trying to get city name from coordinates using flutter geocoding library, but it give output in form of "Instance of 'Future'" instead of city name. Code in the screenshot. please help me here.
i'm trying to get solution from this issue.
For example, you can use await
like this:
String cityName = await GeocodingPlatform.instance.placemarkFromCoordinates(latitude, longitude).then((value) => value.first.locality);
Or you can use then
like this:
GeocodingPlatform.instance.placemarkFromCoordinates(latitude, longitude).then((value) {
String cityName = value.first.locality;
// do something with cityName
});