google_places_picker 0.0.6
google_places_picker: ^0.0.6 copied to clipboard
Flutter plugin for Google Places and Autocomplete.
google_places_picker #
Google Place Picker and Autocomplete for Flutter
Getting Started #
Setting up #
- Go to your
AndroidManifest.xml
atandroid/app/src/main
and add the following in between theapplication
opening and closing tag, replacingYOUR_API_KEY
with your api key, which you can get from the Google Developer Console:
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="YOUR_API_KEY"/>
- Go to
AppDelegate.m/.swift
inios/Runner
, and in thedidFinishLaunchingWithOptions
method add the following lines:
- Swift
GMSPlacesClient.provideApiKey("YOUR_API_KEY")
GMSSServices.provideApiKey("YOUR_API_KEY")
- Objective-C
[GMSPlacesClient provideApiKey:@"YOUR_API_KEY"];
[GMSServices provideApiKey:@"YOUR_API_KEY"];
Usage #
You can use the plugin via the showPlacePicker
and showAutocomplete
methods. The showAutocomplete
method takes a PlaceAutocompleteMode paramater to know whether to display the fullscreen or the overlay control on Android (it has no effect on iOS). Both methods return a Place
object with the following properties:
- name
- id
- address
- latitude
- longitude