google_places_flutter 2.0.3

Flutter Android iOS web

Custom Google places autocomplete widget for Android and iOS both. Use https://pub.dev/packages/google_places_flutter

google_places_flutter #

Add dependency into pubspec.yml #

dependencies:
  flutter:
    sdk: flutter
  google_places_flutter: <last-version>
  

Google AutoComplete TextField Widget code #

    GooglePlaceAutoCompleteTextField(
        textEditingController: controller,
        googleAPIKey: "YOUR_GOOGLE_API_KEY",
        inputDecoration: InputDecoration()
        debounceTime: 800 // default 600 ms,
        countries: ["in","fr"],// optional by default null is set
        isLatLngRequired:true,// if you required coordinates from place detail
        getPlaceDetailWithLatLng: (Prediction prediction) {
         // this method will return latlng with place detail
        print("placeDetails" + prediction.lng.toString());
        }, // this callback is called when isLatLngRequired is true
        itmClick: (Prediction prediction) {
         controller.text=prediction.description;
          controller.selection = TextSelection.fromPosition(TextPosition(offset: prediction.description.length));
        }
    )
    

Customization Option #

You can customize a text field input decoration and debounce time

Screenshorts #

4
likes
90
pub points
76%
popularity

Custom Google places autocomplete widget for Android and iOS both. Use https://pub.dev/packages/google_places_flutter

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

shruti.sm87@gmail.com

License

MIT (LICENSE)

Dependencies

dio, flutter, rxdart

More

Packages that depend on google_places_flutter