PlaceApiProvider class abstract
The contract for a Google Places backend used by the autocomplete widgets.
Two implementations are built in: LegacyPlaceApiProvider (legacy Places
API) and NewPlaceApiProvider (Places API (New)), selected by the
widgets' apiVersion parameter. Supply your own implementation via the
widgets' placeApiProvider parameter to use a different backend entirely
(a native Places SDK wrapper, a backend proxy that holds your API key
server side, or a test fake).
Implementations must:
- return an empty list from fetchSuggestions when there are no results (never throw for "no matches");
- throw an Exception with a human-readable message on API errors;
- honor Google billing-session semantics: all fetchSuggestions calls for one user interaction share a session token, and getPlaceDetailFromId terminates that session.
- Implementers
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
fetchSuggestions(
String input, {bool includeFullSuggestionDetails = false, required List< AutoCompleteType> types}) → Future<List< Suggestion> > -
Returns autocomplete suggestions for
input, restricted totypes. -
getPlaceDetailFromId(
String placeId) → Future< Place> -
Returns full address details for the suggestion with
placeId. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited