locationpicker icon indicating copy to clipboard operation
locationpicker copied to clipboard

LocationResult return null

Open s2yed opened this issue 3 years ago • 4 comments

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

print(result);

s2yed avatar Jan 20 '22 10:01 s2yed

Same for me.

jrcmadushanka avatar Mar 11 '22 00:03 jrcmadushanka

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

brianmutiso avatar Apr 22 '22 14:04 brianmutiso

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

luislukas avatar Apr 27 '22 23:04 luislukas

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

fulcus avatar Jul 06 '22 09:07 fulcus