KeyboardOptions class
Options to configure how keyboard keys may be used to control the map
When a key is pushed down, an animation starts, consisting of a curved portion which takes the animation to its maximum velocity, an indefinitely long animation at maximum velocity, then ended on the key up with another curved portion.
If a key is pressed and released quickly, it might trigger a short animation called a 'leap'. The leap consists of a part of the curved portion, and also scales the velocity of the concerned gesture.
See CursorKeyboardRotationOptions for options to control the keyboard and mouse cursor being used together to rotate the map.
- Annotations
Constructors
- KeyboardOptions.new({bool enableArrowKeysPanning = true, bool enableWASDPanning = false, bool enableQERotating = false, bool enableRFZooming = false, double maxPanVelocity(double zoom)?, double panLeapVelocityMultiplier = 5, double maxZoomVelocity = 0.03, double zoomLeapVelocityMultiplier = 3, double maxRotateVelocity = 3, double rotateLeapVelocityMultiplier = 3, Duration animationCurveDuration = const Duration(milliseconds: 450), Duration? animationCurveReverseDuration = const Duration(milliseconds: 600), Curve animationCurveCurve = Curves.easeInOut, Duration? performLeapTriggerDuration = const Duration(milliseconds: 100), double leapMaxOfCurveComponent = 0.6, FocusNode? focusNode, bool autofocus = true})
-
Create options which specify how the map may be controlled by keyboard
keys
const
- KeyboardOptions.disabled()
-
Disable keyboard control of the map
const
Properties
- animationCurveCurve → Curve
-
Curve of the curved portion of the animation occuring after key down and
key up events
final
- animationCurveDuration → Duration
-
Duration of the curved (Curves.easeIn) portion of the animation occuring
after a key down event (and after a key up event if
animationCurveReverseDuration is
null
)final - animationCurveReverseDuration → Duration?
-
Duration of the curved (reverse Curves.easeIn) portion of the animation
occuring after a key up event
final
- autofocus → bool
-
Whether to request focus as soon as the map widget appears (and to enable
keyboard controls)
final
- enableArrowKeysPanning → bool
-
Whether to allow arrow keys to pan the map (in their respective
directions)
final
- enableQERotating → bool
-
Whether to allow the Q & E keys (*) to rotate the map (Q rotates
anticlockwise, E rotates clockwise)
final
- enableRFZooming → bool
-
Whether to allow the R & F keys to zoom the map (R zooms IN (increases
zoom level), F zooms OUT (decreases zoom level))
final
- enableWASDPanning → bool
-
Whether to allow the W, A, S, D keys (*) to pan the map (in the directions
UP, LEFT, DOWN, RIGHT respectively)
final
- focusNode → FocusNode?
-
Custom FocusNode to be used instead of internal node
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- leapMaxOfCurveComponent → double
-
The percentage (0.0 - 1.0) of the curve animation component that is driven
to (from 0), then in reverse from (to 0)
final
- maxPanVelocity → double Function(double zoom)?
-
The maximum offset to apply per frame to the camera's center during a pan
animation, given the current camera zoom level
final
- maxRotateVelocity → double
-
The maximum angular difference to apply per frame to the camera's rotation
during a rotation animation
final
- maxZoomVelocity → double
-
The maximum zoom level difference to apply per frame to the camera's zoom
level during a zoom animation
final
- panLeapVelocityMultiplier → double
-
The amount to scale the panning offset velocity by during a leap animation
final
- performLeapTriggerDuration → Duration?
-
Maximum duration between the key down and key up events of an animation
which will trigger a 'leap'
final
- rotateLeapVelocityMultiplier → double
-
The amount to scale the rotation velocity by during a leap animation
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- zoomLeapVelocityMultiplier → double
-
The amount to scale the zooming velocity by during a leap animation
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override