google_maps_place_picker
google_maps_place_picker copied to clipboard
Searching Location in TextField, autocomplete doesnt work no locations found and Indicator running
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...
Nobody here answer to the issue?
Nearly the same issue with 2.0.0-nullsafety.3 on Flutter 2.0.4
E/flutter (25056): [ERROR:flutter/lib/ui/ui_dart_state.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_maps_webservice/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_maps_webservice/src/places.dart:934
E/flutter (25056): #4 _$PlacesAutocompleteResponseFromJson.
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):
did you try to enable place API in google cloud console?
please help similar issue. Already enabled places api on google console. Still nothing
Make sure you have enabled billing because apis like geocoding and places require billing to be enabled.