CurrentLocationLayer class
A layer for current location marker in FlutterMap.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- CurrentLocationLayer
- Available extensions
Constructors
-
CurrentLocationLayer({Key? key, LocationMarkerStyle style = const LocationMarkerStyle(), Stream<
LocationMarkerPosition?> ? positionStream, Stream<LocationMarkerHeading?> ? headingStream, FocalPoint focalPoint = const FocalPoint(), Stream<double?> ? alignPositionStream, AlignOnUpdate alignPositionOnUpdate = AlignOnUpdate.never, Stream<void> ? alignDirectionStream, AlignOnUpdate alignDirectionOnUpdate = AlignOnUpdate.never, Duration alignPositionAnimationDuration = const Duration(milliseconds: 200), Curve alignPositionAnimationCurve = Curves.fastOutSlowIn, Duration alignDirectionAnimationDuration = const Duration(milliseconds: 120), Curve alignDirectionAnimationCurve = Curves.easeOut, Duration moveAnimationDuration = const Duration(milliseconds: 200), Curve moveAnimationCurve = Curves.fastOutSlowIn, Duration rotateAnimationDuration = const Duration(milliseconds: 120), Curve rotateAnimationCurve = Curves.easeOut, double zoomThreshold = 0.01, double positionThreshold = 2, double headingThreshold = pi / 100, LocationMarkerIndicators indicators = const LocationMarkerIndicators(), ExceptionCallback errorHandler = defaultErrorHandler}) -
Create a CurrentLocationLayer.
const
Properties
- alignDirectionAnimationCurve → Curve
-
The curve of the animation of turning the map to align the heading.
Default to Curves.easeOut.
final
- alignDirectionAnimationDuration → Duration
-
The duration of the animation of turning the map to align the heading.
Default to 120ms.
final
- alignDirectionOnUpdate → AlignOnUpdate
-
When should the plugin rotate the map to keep the heading upward. Default
to AlignOnUpdate.never.
final
-
alignDirectionStream
→ Stream<
void> ? -
A stream that emits an 'align direction event'. Emit an event to this
stream to align the marker direction upwards. Defaults to null.
final
- alignPositionAnimationCurve → Curve
-
The curve of the animation of following the map to the current location.
Default to Curves.fastOutSlowIn.
final
- alignPositionAnimationDuration → Duration
-
The duration of the animation of following the map to the current
location. Default to 200ms.
final
- alignPositionOnUpdate → AlignOnUpdate
-
When should the map follow current location. Default to
AlignOnUpdate.never.
final
-
alignPositionStream
→ Stream<
double?> ? -
A stream that emits an 'align position event'. Emit an event with a
optional zoom level to this stream to align the marker position to the
focal point at the specified zoom level. If null is emitted, the zoom
level remains unchanged. Defaults to null.
final
- errorHandler → ExceptionCallback
-
A handler called when an exception is thrown from position stream or
heading stream. This is for customizing the behavior of the plugin when an
exception occurs.
final
- focalPoint → FocalPoint
-
A screen point to align the marker when an 'align position event' is
emitted. An 'align position event' is emitted under the following
circumstances:
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
headingStream
→ Stream<
LocationMarkerHeading?> ? -
A stream that provides heading data for this marker. Defaults to
LocationMarkerDataStreamFactory.fromRotationSensorHeadingStream.
final
- headingThreshold → double
-
Minimum angular difference (in radians) required to update heading.
Applied to both marker rotation and map rotation. Changes less than or
equal to this threshold are ignored. Defaults to
π / 100radians.final - indicators → LocationMarkerIndicators
-
The indicators which will display when in special status.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- moveAnimationCurve → Curve
-
The curve of the marker's move animation. Default to
Curves.fastOutSlowIn.
final
- moveAnimationDuration → Duration
-
The duration of the marker's move animation. Default to 200ms.
final
-
positionStream
→ Stream<
LocationMarkerPosition?> ? -
A stream that provides position data for this marker. Defaults to
LocationMarkerDataStreamFactory.fromGeolocatorPositionStream.
final
- positionThreshold → double
-
Minimum screen-space distance (in pixels) required to update position.
Applied to both marker movement and map alignment movement. Changes less
than or equal to this threshold are ignored. Defaults to
2.0pixels.final - pZero → Widget
-
Available on Widget, provided by the WidgetsExtension extension
no setter - rotateAnimationCurve → Curve
-
The curve of the heading sector rotate animation. Default to
Curves.easeOut.
final
- rotateAnimationDuration → Duration
-
The duration of the heading sector rotate animation. Default to 120ms.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sliverBox → Widget
-
Available on Widget, provided by the WidgetSliverBoxX extension
no setter - style → LocationMarkerStyle
-
The style to use for this location marker.
final
- zoomThreshold → double
-
Minimum absolute zoom-level difference required to run map align
animation. If
|currentZoom - targetZoom|is less than or equal to this threshold, zoom change alone will not trigger map movement animation. Defaults to0.01.final
Methods
-
alignAtBottomCenter(
{Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
alignAtBottomLeft(
{Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
alignAtBottomRight(
{Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
alignAtCenter(
{Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
alignAtCenterLeft(
{Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
alignAtCenterRight(
{Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
alignAtLERP(
Alignment a, Alignment b, double t, {Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
alignAtTopCenter(
{Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
alignAtTopLeft(
{Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
alignAtTopRight(
{Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
alignXY(
double x, double y, {Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
card(
{Color? backgroundColor, double elevation = 1, EdgeInsets? margin}) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
container(
{double? width, double? height, Alignment? alignment, Color? backgroundColor, double borderWidth = 1, double radius = 1, Color borderColor = Colors.transparent, EdgeInsets? padding, EdgeInsets? margin, BoxConstraints? constraints}) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< CurrentLocationLayer> -
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.
override
-
expanded(
{int flex = 1}) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
fit(
{Alignment alignment = Alignment.center}) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
form(
GlobalKey< FormState> key) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
ltr(
) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onDoubleTap(
GestureTapCallback? onPressed) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
onLongPress(
GestureTapCallback? onPressed) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
onTap(
GestureTapCallback? onPressed) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
onTapInk(
GestureTapCallback? onPressed) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
pAll(
double padding) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
pOnly(
{double left = 0.0, double top = 0.0, double right = 0.0, double bottom = 0.0}) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
pSymmetric(
{double horizontal = 0.0, double vertical = 0.0}) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
rotate(
double scale) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
rtl(
) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
safeArea(
) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
scale(
double scale) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
scrollable(
{Axis scrollDirection = Axis.vertical}) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
showMenus(
List< PopupMenuEntry< items) → Widgetint> > -
Available on Widget, provided by the WidgetsExtension extension
-
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
-
translate(
Offset offset) → Widget -
Available on Widget, provided by the WidgetsExtension extension
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited