blackmann / locationpicker

Location picker for Flutter.
Other
165 stars 159 forks source link

LocationResult return null #69

Open s2yed opened 2 years ago

s2yed commented 2 years ago

result = await Navigator.of(context).push(MaterialPageRoute( builder: (context) => PlacePicker(keyMap, displayLocation: LatLng(lat,lon), )));

print(result);
jrcmadushanka commented 2 years ago

Same for me.

brianmutiso commented 2 years ago

This library practically doesnt work and is neither useful for any reasonable use

luislukas commented 2 years ago

I was getting the same result until I did some debugging - turns out you have to enable billing in the project for Places Api to work. After setting up billing and link it to the project it works perfectly.

Here are the details: Error while debugging:

0 = {map entry} "error_message" -> "You must enable Billing on the Google Cloud Project at https://console.cloud.google.com/project/_/bi..."
1 = {map entry} "predictions" -> [_GrowableList]
2 = {map entry} "status" -> "REQUEST_DENIED"

You must enable Billing on the Google Cloud Project at https://console.cloud.google.com/project/_/billing/enable Learn more at https://developers.google.com/maps/gmp-get-started

fulcus commented 2 years ago

Geocoding API needs to be enabled for the plugin to work and return actual place info (and not null), whereas the Places API is optional and needed only if you want to display "Places" such as restaurants etc.

Geocoding API: https://console.cloud.google.com/apis/library/geocoding-backend.googleapis.com