3

How can I convert location latitude and longitude to a formated address? I'm trying with geocoder plugin but the line- await Geocoder.local.findAddressesfromCoordinates(coordinates) gives me an error with showing platform exception. I used this plugin more times and it worked nicely, but this time in all my projects it shows same error, please help to solve.

var coordinates = new Coordinates(latitude, longitude);
var addresses = 
await Geocoder.local.findAddressesFromCoordinates(coordinates);
var first = addresses.first;
var myAddress = first.addressLine;

** When I want to convert coordinates find this error :
Unhandled Exception: PlatformException(failed, Failed, null) show error Message**

Bijoya_Banik
  • 387
  • 4
  • 12

1 Answers1

4

Use:

await Geocoder.google(your_API_Key).findAddressesFromCoordinates(coordinates);

Instead of:

await Geocoder.local.findAddressesFromCoordinates(coordinates);
thatguy
  • 21,059
  • 6
  • 30
  • 40