fysoul17 / google_maps_place_picker

Place picker on Google Maps for Flutter
MIT License
223 stars 365 forks source link

Searching Location in TextField, autocomplete doesnt work no locations found and Indicator running #114

Open wytex opened 3 years ago

wytex commented 3 years ago

I have setting up the plugin and everything is working search form field apart. I can get any location on autocmplete if I try to write into textfield I can pick Address with picker but autocmplete doesnt work. I just used simply method to pick it:

ElevatedButton(onPressed: (){
                      Navigator.push(
                        context,
                        MaterialPageRoute(
                          builder: (context) => PlacePicker(
                            apiKey: 'mycurrentAPI', 
                            onPlacePicked: (result) {
                              selectedPlace = result;
                              print(result);
                              Navigator.of(context).pop();
                            },
                            initialPosition: _ShipmentCreatorScreenState.kInitialPosition,
                            useCurrentLocation: true,
                          ),
                        ),
                      );
                    }, child: Text('Select an Address')),

I dont get any error just the circularProgress indicator is working infinitely when I start typing a location.... as per picture... Screenshot_1617361259

wytex commented 3 years ago

Nobody here answer to the issue?

t-kietzmann commented 3 years ago

Nearly the same issue with 2.0.0-nullsafety.3 on Flutter 2.0.4

E/flutter (25056): [ERROR:flutter/lib/ui/ui_dartstate.cc(186)] Unhandled Exception: type 'Null' is not a subtype of type 'String' in type cast E/flutter (25056): #0 $StructuredFormattingFromJson package:google_maps_webservice/src/places.g.dart:426 E/flutter (25056): #1 new StructuredFormatting.fromJson package:google_mapswebservice/src/places.dart:1004 E/flutter (25056): #2 $PredictionFromJson package:google_maps_webservice/src/places.g.dart:375 E/flutter (25056): #3 new Prediction.fromJson package:google_mapswebservice/src/places.dart:934 E/flutter (25056): #4 $PlacesAutocompleteResponseFromJson. package:google_maps_webservice/src/places.g.dart:341 E/flutter (25056): #5 MappedListIterable.elementAt (dart:_internal/iterable.dart:411:31)

E/flutter (25056): #6 ListIterator.moveNext (dart:_internal/iterable.dart:340:26) E/flutter (25056): #7 new _GrowableList._ofEfficientLengthIterable (dart:core-patch/growable_array.dart:188:27) E/flutter (25056): #8 new _GrowableList.of (dart:core-patch/growable_array.dart:150:28) E/flutter (25056): #9 new List.of (dart:core-patch/array_patch.dart:50:28) E/flutter (25056): #10 ListIterable.toList (dart:internal/iterable.dart:211:44) E/flutter (25056): #11 $PlacesAutocompleteResponseFromJson package:google_maps_webservice/src/places.g.dart:342 E/flutter (25056): #12 new PlacesAutocompleteResponse.fromJson package:google_maps_webservice/src/places.dart:894 E/flutter (25056): #13 GoogleMapsPlaces._decodeAutocompleteResponse package:google_maps_webservice/src/places.dart:531 E/flutter (25056): #14 GoogleMapsPlaces.autocomplete package:google_maps_webservice/src/places.dart:171 E/flutter (25056): E/flutter (25056): #15 AutoCompleteSearchState._performAutoCompleteSearch package:google_maps_place_picker/src/autocomplete_search.dart:280 E/flutter (25056):

wytex commented 3 years ago

did you try to enable place API in google cloud console?

Abdul-AzeezO commented 3 years ago

please help similar issue. Already enabled places api on google console. Still nothing

saad3344555 commented 3 years ago

Make sure you have enabled billing because apis like geocoding and places require billing to be enabled.