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)?, 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? lightAdress = false, Color? iconColor = Colors.grey, Mode mode = Mode.fullscreen, int historyMaxLength = 5, Widget? loadingWidget})
const

Properties

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
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
lightAdress bool?
lightAdress : (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

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}) 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