在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):bazrafkan/google_place开源软件地址(OpenSource Url):https://github.com/bazrafkan/google_place开源编程语言(OpenSource Language):Dart 99.6%开源软件介绍(OpenSource Introduction):google_placeA Flutter plugin for iOS and Android and Web that provides a Google Place API. PreviewThe Places API is a service that returns information about places using HTTP requests. Places are defined within this API as establishments, geographic locations, or prominent points of interest. The following place requests are available:
UsageTo use this plugin, add google_place as a dependency in your pubspec.yaml file. Getting Started
ExampleSample Usage
var googlePlace = GooglePlace("Your-Key");
var result = await googlePlace.autocomplete.get("1600 Amphitheatre");
var googlePlace = GooglePlace("Your-Key");
var result = await googlePlace.queryAutocomplete.get("pizza near sydne");
var googlePlace = GooglePlace("Your-Key");
Uint8List result = await googlePlace.photos.get(
"CnRtAAAATLZNl354RwP_9UKbQ_5Psy40texXePv4oAlgP4qNEkdIrkyse7rPXYGd9D_Uj1rVsQdWT4oRz4QrYAJNpFX7rzqqMlZw2h2E2y5IKMUZ7ouD_SlcHxYq1yL4KbKUv3qtWgTK0A6QbGh87GB3sscrHRIQiG2RrmU_jF4tENr9wGS_YxoUSSDrYjWmrNfeEHSGSc3FyhNLlBU", null, 400);
var googlePlace = GooglePlace("Your-Key");
Uint8List result = await googlePlace.details.get("ChIJN1t_tDeuEmsRUsoyG83frY4",
fields: "name,rating,formatted_phone_number")
Custom HeadersNow is possible to set custom header to use platform-specific API keys where you must provide the following headers. final headers = <String, String>{
if (defaultTargetPlatform == TargetPlatform.iOS)
'x-ios-bundle-identifier': Env().bundleIdentifier, // com.my.app
if (defaultTargetPlatform == TargetPlatform.android) ...{
'x-android-package': Env().bundleIdentifier, // com.my.app
'x-android-cert': Env().ANDROID_SIGNING_KEY_SHA1, // signing key used to build/publish the app
}
};
var googlePlace = GooglePlace("Your-Key", headers: headers); Proxy URL for WebNow is possible to set proxy url for web. proxyUrl can be formatted as [https:// || http://]host[:][/][?=] var googlePlace = GooglePlace("Your-Key", proxyUrl: 'https://localhost:5000'); |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论