LocationSearchWidget class

Principal widget to show Flutter map using osm api with search bar. you can track you current location, search for a location and select it. navigate easily in the map to selecte location.

Inheritance

Constructors

LocationSearchWidget({Key? key, required void onPicked(LocationData data)?, required UserAgent userAgent, void onError(Exception e)?, String? language = 'en', List<String>? countryCodes, Color? searchBarBackgroundColor, Color searchBarTextColor = Colors.black87, String searchBarHintText = 'Search location', String currentPositionButtonText = 'Use current location', Color searchBarHintColor = Colors.black87, bool lightAddress = false, Color iconColor = Colors.grey, Mode mode = Mode.fullscreen, int historyMaxLength = 5, bool showAddressNumberOption = true, String addressNumberButtonText = "Add number", IconData? addressNumberButtonIcon = Icons.add, Color? addressNumberButtonColor, Color? addressNumberButtonBackground, double addressNumberButtonTextSize = 12, Widget upperWidget(BuildContext context)?, String? googlePlacesSearchKey, Widget? loadingWidget})
const

Properties

addressNumberButtonBackground Color?
addressNumberButtonBackground : (Color) Add number button background color
final
addressNumberButtonColor Color?
addressNumberButtonColor : (Color) Add number button foreground color
final
addressNumberButtonIcon IconData?
addressNumberButtonIcon : (IconData) Add number button icon
final
addressNumberButtonText String
addressNumberButtonText : (String) Add number button text
final
addressNumberButtonTextSize double
addressNumberButtonTextSize : (double) Add number button text and icon size
final
countryCodes List<String>?
countryCodes : Limit search results to one or more countries
final
currentPositionButtonText String
currentPositionButtonText : (String) change the text of the button selecting current position
final
googlePlacesSearchKey String?
googlePlacesSearchKey : Key to get the Google Places API search
final
hashCode int
The hash code for this object.
no setterinherited
historyMaxLength int
historyMaxLength : (int) maximum length of history and suggested location
final
iconColor Color
iconColor : (Color) change the color of the search bar text
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
language String?
language : (String) set the language of the map and address text (default = 'en')
final
lightAddress bool
lightAddress : (bool) if true, displayed and returned adresses will be lighter
final
loadingWidget Widget?
loadingWidget : (Widget) show custom widget until the map finish initialization
final
mode Mode
mode : mode of display: fullscreen or overlay
final
onError → void Function(Exception e)?
onError : (callback) is triggered when an error occurs while fetching location
final
onPicked → void Function(LocationData data)?
onPicked : (callback) is triggered when you click on a location, returns current PickedData of the Marker
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
searchBarBackgroundColor Color?
searchBarBackgroundColor : (Color) change the background color of the search bar
final
searchBarHintColor Color
searchBarHintColor : (Color) change the color of the search bar hint text
final
searchBarHintText String
searchBarHintText : (String) change the hint text of the search bar
final
searchBarTextColor Color
searchBarTextColor : (Color) change the color of the search bar text
final
showAddressNumberOption bool
showAddressNumberOption : (bool) shows the Add number button
final
upperWidget Widget Function(BuildContext context)?
upperWidget : Widget to show upside the list
final
userAgent UserAgent
userAgent : OpenStreetMap’s Nominatim service (used for geocoding) requires a user-agent to identify your application. If you don’t provide one, your requests might get blocked or throttled
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<LocationSearchWidget>
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, int wrapWidth = 65}) 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