Closed Xoshbin closed 3 years ago
Component class isn't automatically detected by my Android Studio, The suggested quick fix presented to me was to create your own Component Class.
Here's an example of autocompleteComponents by importing 'package:google_maps_webservice/places.dart'
import 'package:google_maps_webservice/places.dart' as google_maps_api;
PlacePicker(
apiKey: APIKeys.apiKey, // Put YOUR OWN KEY here.
autocompleteComponents: [
google_maps_api.Component("country", "fr") //restrict search results to France
],
onPlacePicked: (result) {
print(result.address);
Navigator.of(context).pop();
},
initialPosition: HomePage.kInitialPosition,
useCurrentLocation: true,
),
Component Class documentation.
Hi, Can anyone please give an example of how to use autocompleteComponents. Thank you
I want to restrict the placePicker to an area or a city if possible?!