Flutter Google Places Web #
A web designed form field for Google Places Autocomplete
API key #
To use this library you need a Web API key. Here
FlutterGooglePlacesWeb is a Google Places Autocomplete field for Flutter Web.
import 'package:flutter_google_places_web/flutter_google_places_web.dart'; FlutterGooglePlacesWeb( apiKey: <GOOGLE_API_KEY>, proxyURL: 'https://cors-anywhere.herokuapp.com/', components: 'country:us', ),
If you have XMLHttpRequest errors, please use a proxy. For more information please see cors-anywhere
If a user types and selects 1600 Amphitheatre Parkway you can retrieve the data
String name = FlutterGooglePlacesWeb.value['name']; String streetAddress = FlutterGooglePlacesWeb.value['streetAddress']; String city = FlutterGooglePlacesWeb.value['city']; String country = FlutterGooglePlacesWeb.value['country']; print(name); // '1600 Amphitheatre Parkway, Mountain View, CA, USA' print(streetAddress); // '1600 Amphitheatre Parkway' print(city); // 'CA' print(country); // 'USA'
[0.0.9] - Fixed form validation #
[0.0.8] - Fixed flex error when padding applied to FlutterGooglePlacesWeb #
[0.0.6] - Added validation and decoration #
[0.0.5] - Added example #
- Added example
- Cleaned comments
- Added notes
[0.0.4] - Added session token #
- Added uuid dependency
- Added sessiontoken bool - defaults to true
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies: flutter_google_places_web: ^0.0.9
2. Install it
You can install packages from the command line:
$ flutter pub get
Alternatively, your editor might support
flutter pub get.
Check the docs for your editor to learn more.
3. Import it
Now in your Dart code, you can use:
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
We analyzed this package on Jul 6, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.8.4
- pana: 0.13.13
- Flutter: 1.17.5
Package not compatible with SDK dart
because of import path [flutter_google_places_web] that is in a package requiring null.
flutter format to format
Package is pre-v0.1 release. (-10 points)
While nothing is inherently wrong with versions of
0.0.*, it might mean that the author is still experimenting with the general direction of the API.
Maintain an example.
None of the files in the package's
example/ directory matches known example patterns.
Common filename patterns include
flutter_google_places_web.dart. Packages with multiple examples should provide
For more information see the pub package layout conventions.
|Dart SDK||>=2.7.0 <3.0.0|