如何在 Place Picker Package Flutter 中使用自动补全组件
How to Use autocompleteComponents in PlacePicker Package Flutter
我正在使用 PlacePicker Flutter 包,该包有一个名为
的参数
autocompleteComponents : A grouping of places to which you would like to restrict your results. Currently, you can use components to filter by up to 5 countries.
但我无法在任何地方找到如何使用此参数我无法启动组件列表
找到答案
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,
),
我正在使用 PlacePicker Flutter 包,该包有一个名为
的参数autocompleteComponents : A grouping of places to which you would like to restrict your results. Currently, you can use components to filter by up to 5 countries.
但我无法在任何地方找到如何使用此参数我无法启动组件列表
找到答案
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,
),