PlacesAutocompleteWidget class

Inheritance

Constructors

PlacesAutocompleteWidget({Key? key, required String? apiKey, Mode mode = Mode.fullscreen, String? hint = 'Search', EdgeInsets? insetPadding, Widget? backArrowIcon, BorderRadius? overlayBorderRadius, num? offset, Location? location, Location? origin, num? radius, String? language, String? sessionToken, List<String>? types, List<Component>? components, bool? strictbounds, String? region, ValueChanged<PlacesAutocompleteResponse>? onError, String? proxyBaseUrl, Client? httpClient, String? startText, Duration? debounce, Map<String, String>? headers, InputDecoration? textDecoration, TextStyle? textStyle, Color? cursorColor, TextStyle? resultTextStyle})

Properties

apiKey String?
The API key to use for the Places API.
final
backArrowIcon Widget?
The back arrow icon in the leading of the appbar. This is only used in Mode.overlay.
final
components List<Component>?
A grouping of places to which you would like to restrict your results. Currently, you can use components to filter by up to 5 countries. Countries must be passed as a two character, ISO 3166-1 Alpha-2 compatible country code.
final
cursorColor Color?
The color of the cursor of the search text field.
final
debounce Duration?
The debounce time for the search query. Default is 300ms.
final
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>?
The additional HTTP headers to send with the request, along with the headers from google_api_headers.
final
hint String?
The hint text to show in the search field. Default is 'Search'.
final
httpClient → Client?
optional - set 'client' value in google_maps_webservice
final
insetPadding EdgeInsets?
This defines the space between the screen's edges and the dialog. This is only used in Mode.overlay.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
language String?
The language in which to return results.
final
location → Location?
The point around which to retrieve place information. The radius parameter must also be provided when specifying a location. If radius is not provided, the location parameter is ignored.
final
The logo to display. Default is the powered by Google logo.
final
mode Mode
The mode of the autocomplete widget.
final
offset num?
The position, in the input term, of the last character that the service uses to match predictions.
final
onError ValueChanged<PlacesAutocompleteResponse>?
The callback will be called when the autocomplete has an error.
final
origin → Location?
The origin point from which to calculate straight-line distance to the destination (returned as distance_meters). If this value is omitted, straight-line distance will not be returned.
final
overlayBorderRadius BorderRadius?
The BorderRadius used for the dialog in Mode.overlay.
final
proxyBaseUrl String?
optional - sets 'proxy' value in google_maps_webservice
final
radius num?
Defines the distance (in meters) within which to return place results. You may bias results to a specified circle by passing a location and a radius parameter.
final
region String?
The region code, specified as a ccTLD ("top-level domain") two-character value. Most ccTLD codes are identical to ISO 3166-1 codes, with some notable exceptions.
final
resultTextStyle TextStyle?
Text style for each result's text.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sessionToken String?
A random string which identifies an autocomplete session for billing purposes.
final
startText String?
The initial text to show in the search field.
final
strictbounds bool?
Returns only those places that are strictly within the region defined by location and radius. This is a restriction, rather than a bias, meaning that results outside this region will not be returned even if they match the user input.
final
textDecoration InputDecoration?
Decoration for search text field
final
textStyle TextStyle?
Text style for search text field
final
types List<String>?
You can restrict results from a Place Autocomplete request to be of a certain type by passing the types parameter.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<PlacesAutocompleteWidget>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

of(BuildContext context) PlacesAutocompleteState