Skip to content
pubscout

google_places_autocomplete_text_field

4.2.0, released 3 months ago by gowdysoftware.de

A fully customizable Google Places autocomplete TextFormField for Flutter applications.

$ flutter pub add google_places_autocomplete_text_field
Source repository

What it does

Provides a customized Flutter TextFormField widget that displays address and location autocomplete suggestions directly from the Google Places API. It handles debouncing, API key configuration, country restrictions, and fetching optional place details and coordinates.

AI-written summary of version 4.2.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need an address search input field powered by Google Places
  • You require customizable UI suggestions within a standard text form field

Skip it when

  • You are not using the Google Places API
  • You need offline place searching

Strengths

  • Integrates seamlessly with forms using a standard TextFormField
  • Supports web configuration via proxy URL to avoid CORS errors
  • Allows retrieving lat/lng coordinates and address components directly from predictions

Weaknesses

  • Requires a valid Google Places API key and active network connection
  • Web platform usage requires a custom proxy URL to handle CORS

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
3

Requires a Google Places API key. For web builds, a proxy URL must be configured to bypass CORS errors.

GooglePlacesAutoCompleteTextFormField(
  textEditingController: controller,
  config: const GoogleApiConfig(
    apiKey: 'YOUR_GOOGLE_API_KEY',
    debounceTime: 400,
  ),
  onSuggestionClicked: (prediction) {
    controller.text = prediction.description;
  },
)

Alternatives

Packages that do the same job and could replace google_places_autocomplete_text_field.

Works with

Packages commonly used together with google_places_autocomplete_text_field: ones it builds on, ones built on it, and its own family.