MapLocationPicker class

Inheritance

Constructors

MapLocationPicker({Key? key, LocationAccuracy desiredAccuracy = LocationAccuracy.high, required String apiKey, String? geoCodingBaseUrl, Client? geoCodingHttpClient, Map<String, String>? geoCodingApiHeaders, String? language, List<String> locationType = const [], List<String> resultType = const [], MinMaxZoomPreference minMaxZoomPreference = const MinMaxZoomPreference(0, 16), EdgeInsets padding = const EdgeInsets.all(0), bool compassEnabled = true, bool liteModeEnabled = false, EdgeInsetsGeometry topCardMargin = const EdgeInsets.all(8), Color? topCardColor, ShapeBorder topCardShape = const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(12))), BorderRadiusGeometry borderRadius = const BorderRadius.all(Radius.circular(12)), String searchHintText = "Start typing to search", ShapeBorder bottomCardShape = const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(12))), EdgeInsetsGeometry bottomCardMargin = const EdgeInsets.fromLTRB(8, 8, 8, 16), Icon bottomCardIcon = const Icon(Icons.send), String bottomCardTooltip = "Continue with this location", Color? bottomCardColor, bool hasLocationPermission = true, dynamic getLocation()?, dynamic onSuggestionSelected(PlacesDetailsResponse?)?, dynamic onNext(GeocodingResult?)?, LatLng? currentLatLng = const LatLng(28.8993468, 76.6250249), bool hideBackButton = false, bool popOnNextButtonTaped = false, Widget? backButton, bool hideMoreOptions = false, String dialogTitle = 'You can also use the following options', Client? placesHttpClient, Map<String, String>? placesApiHeaders, String? placesBaseUrl, String? sessionToken, num? offset, Location? origin, Location? location, num? radius, String? region, List<String> fields = const [], List<String> types = const [], List<Component> components = const [], bool strictbounds = false, bool hideSuggestionsOnKeyboardHide = false, MapType mapType = MapType.normal, TextEditingController? searchController, Map<String, LatLng>? additionalMarkers, bool bottom = true, bool left = true, bool maintainBottomViewPadding = false, EdgeInsets minimum = EdgeInsets.zero, bool right = true, bool top = true, bool hideLocationButton = false, bool hideMapTypeButton = false, bool hideBottomCard = false, dynamic onDecodeAddress(GeocodingResult?)?})
const

Properties

additionalMarkers Map<String, LatLng>?
Add your own custom markers
final
apiKey String
API key for the map & places
final
backButton Widget?
Back button replacement when hideBackButton is false and backButton is not null
final
borderRadius BorderRadiusGeometry
Top card text field border radius
final
bottom bool
Safe area parameters (default: true)
final
bottomCardColor Color?
Bottom card color
final
bottomCardIcon Icon
Bottom card icon
final
bottomCardMargin EdgeInsetsGeometry
Bottom card margin
final
bottomCardShape ShapeBorder
Bottom card shape
final
bottomCardTooltip String
Bottom card tooltip
final
compassEnabled bool
Compass for the map (default: true)
final
components List<Component>
Components set results to be restricted to a specific area components: Component(Component.country, "us")
final
currentLatLng LatLng?
currentLatLng init location for camera position currentLatLng: Location(lat: -33.852, lng: 151.211),
final
desiredAccuracy LocationAccuracy
GPS accuracy for the map
final
dialogTitle String
Dialog title
final
fields List<String>
List of fields to be returned by the Google Maps Places API. Refer to the Google Documentation here for a list of valid values: https://developers.google.com/maps/documentation/places/web-service/details
final
geoCodingApiHeaders Map<String, String>?
GeoCoding api headers
final
geoCodingBaseUrl String?
GeoCoding base url
final
geoCodingHttpClient → Client?
GeoCoding http client
final
getLocation → (dynamic Function()?)
detect location button click callback
final
hashCode int
The hash code for this object.
no setterinherited
hasLocationPermission bool
On location permission callback
final
hideBackButton bool
Show back button (default: true)
final
hideBottomCard bool
hide bottom card (default: false)
final
hideLocationButton bool
hide location button and map type button (default: false)
final
hideMapTypeButton bool
final
hideMoreOptions bool
Show more suggestions
final
hideSuggestionsOnKeyboardHide bool
Hide Suggestions on keyboard hide
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
language String?
Language code for Places API results language: 'en',
final
left bool
final
liteModeEnabled bool
Lite mode for the map (default: false)
final
location Location?
Location bounds for restricting results to a radius around a location location: Location(lat: -33.867, lng: 151.195)
final
locationType List<String>
GeoCoding location type
final
maintainBottomViewPadding bool
final
mapType MapType
Map type (default: MapType.normal)
final
minimum EdgeInsets
final
minMaxZoomPreference MinMaxZoomPreference
Map minimum zoom level & maximum zoom level
final
offset num?
Offset for pagination of results offset: int,
final
onDecodeAddress → (dynamic Function(GeocodingResult?)?)
When tap on map decode address callback function
final
onNext → (dynamic Function(GeocodingResult?)?)
On Next Page callback
final
onSuggestionSelected → (dynamic Function(PlacesDetailsResponse?)?)
On Suggestion Selected callback
final
origin Location?
Origin location for calculating distance from results origin: Location(lat: -33.852, lng: 151.211),
final
padding EdgeInsets
Padding around the map
final
placesApiHeaders Map<String, String>?
apiHeader is used to add headers to the request.
final
placesBaseUrl String?
baseUrl is used to build the url for the request.
final
placesHttpClient → Client?
httpClient is used to make network requests.
final
popOnNextButtonTaped bool
Popup route on next press (default: false)
final
radius num?
Radius for restricting results to a radius around a location radius: Radius in meters
final
region String?
Region for restricting results to a set of regions region: "us"
final
resultType List<String>
GeoCoding result type
final
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
searchController TextEditingController?
Search text field controller
final
searchHintText String
Top card text field hint text
final
sessionToken String?
Session token for Google Places API
final
strictbounds bool
Bounds for restricting results to a set of bounds
final
top bool
final
topCardColor Color?
Top card color
final
topCardMargin EdgeInsetsGeometry
Top card margin
final
topCardShape ShapeBorder
Top card shape
final
types List<String>
Types for restricting results to a set of place types
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<MapLocationPicker>
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