XL class
A Widget
that allows the definition of a stack of XLayer
s
and/or PLayer
s and that will intrinsically animate them
with a parallax effect based on sensor events (X
)
or pointer data (P
).
Layers
A list of XLayers and/or PLayers, each with their own animatable properties.
Sharing Input
If this XL
has both XLayer
s and PLayer
s, control the sharing of
sensors or pointer data with the opposing Layer
variety
with the respective flags:
Dragging
A parameter class that primarily pertains to PLayer
s and their
parallax animation during an active drag or pointer hover event.
Normalization
A parameter class that primarily pertain to XLayer
s
for customizing the intake of SensorEvent
data.
- Normalization.autocompensates, a flag for toggling autocompensation after steady sensor samples for some time
- Normalization.delay, how long to wait before kicking in
autocompensation, considering
sensitivity
to past samples in a buffer
Animation
The default duration and curve for this XL
's parallax animations
are controlled with these properties.
This applies when the layers are being transformed by sensor data or are resetting/autocompensating.
When PLayers are actively hovered/touched, Dragging applies instead.
Void Callbacks
For Function
performance on state-change:
onPointerEnter
onPointerExit
onCompensation
- Inheritance
Constructors
-
XL({Key? key, required List<
Widget> layers, Dragging dragging = const Dragging(), Normalization normalization = const Normalization(), Duration duration = const Duration(milliseconds: 250), Curve curve = Curves.ease, bool useLocalPosition = true, ReferencePosition referencePosition = ReferencePosition.center, VoidCallback? onPointerEnter, VoidCallback? onPointerExit, VoidCallback? onCompensation}) -
A
Widget
that allows the definition of a stack ofXLayer
s and/orPLayer
s and that will intrinsically animate them with a parallax effect based on sensor events (X
) or pointer data (P
).const
Properties
- curve → Curve
-
The default
Curve
for thisXL
's parallax animations.final - dragging → Dragging
-
A parameter class that primarily pertains to
PLayer
s and their parallax animation during an active drag or pointer hover event.final - duration → Duration
-
The default
Duration
for thisXL
's parallax animations.final - hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
layers
→ List<
Widget> -
A list of
XLayer
s and/orPLayer
s to stack in this parent XL.final - normalization → Normalization
-
A parameter class that primarily pertain to
XLayer
s for customizing the intake ofSensorEvent
data.final - onCompensation → VoidCallback?
-
Provide a function to perform when this
XL
begins one of its autocompensation steps.final - onPointerEnter → VoidCallback?
-
Provide a function to perform when this
XL
'sMouseRegion
andListener
have been entered by a pointer, either mouse or touch input.final - onPointerExit → VoidCallback?
-
Provide a function to perform when this
XL
'sMouseRegion
andListener
have been exited by a pointer, either mouse or touch input.final - referencePosition → ReferencePosition
-
From where the parallax effect should be referenced
when derived from pointer data on a scale from
0..1
.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
If this
XL
has bothXLayer
s andPLayer
s,sharesPointer
settrue
will contribute both sensors data and pointer data towardXLayer
s.final -
If this
XL
has bothXLayer
s andPLayer
s,sharesSensors
settrue
will contribute both sensors data and pointer data towardPLayer
s.final - useLocalPosition → bool
-
Whether the parallax factors derived from pointer data should be
referenced from the size and position of this XL.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _XLState -
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