address_autocomplete_widgets library
Use AddressAutocompleteTextField to replace TextField widgets where you want to add Google Places autocompletion.
Use AddressAutocompleteTextFormField to replace TextFormField widgets where you want to add Google Places autocompletion.
You only requirement is to supply your Google Maps API key in the mapsApiKey parameter.
You optionally can specify the type of Google Places autocomplete information returned using the type or types parameters
(The default is AutoCompleteType.address).
Classes
- AddressAutocompleteTextField
- AddressAutocompleteTextFormField
- Place
- PlaceApiProvider
- The contract for a Google Places backend used by the autocomplete widgets.
- Suggestion
Enums
- AutoCompleteType
- AutoCompleteTypes You can restrict results from a Place Autocomplete request to be of a certain type by passing the types parameter. This parameter specifies a type or a type collection, as listed in Place Types. If nothing is specified, all types are returned.
- PlacesApiVersion
- Selects which Google Places backend the autocomplete widgets use.
Functions
-
validateAutocompleteTypes(
List< AutoCompleteType> types) → void -
Validates the Google Places rules shared by both API backends:
a maximum of 5 type values, and "single only" values (collections such
as
(cities)/(regions)and the legacyaddress/geocode/establishmentfilters) must not be combined with any other value. Throws Exception on violation (same behavior/messages as v1.x).
Typedefs
- ReportValidationFailureAndRequestFocusCallback = bool Function(String errorMessageForThisFailedValidation)