ParallaxStack class
A Widget that allows you to stack and animate the children of parallax layers.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- ParallaxStack
Constructors
-
ParallaxStack({Key? key, required List<
Widget> layers, bool touchBased = false, bool useLocalPosition = true, bool resetOnExit = true, double referencePosition = 0.5, Duration drag = const Duration(milliseconds: 100), Curve dragCurve = Curves.ease, Duration resetDuration = const Duration(milliseconds: 1200), Curve resetCurve = Curves.ease}) -
A Widget that allows you to stack and animate the children of
parallax layers.
const
Properties
- drag → Duration
-
The duration of the animation that takes place
when pointer events occur and when the widget
transforms. By default, it is set to 100 milliseconds.
final
- dragCurve → Curve
-
The duration of the animation that takes place
when pointer events occur and when the widget
transforms. By default, it is set to Curves.ease.
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 ParallaxLayers
final
- referencePosition → double
-
Where the parallax effect should be referenced from. This is a scale
from 0-1. Its default value is 0.5, meaning that the
parallax is referenced from the center.
final
- resetCurve → Curve
-
The curve of the animation that occurs when
the pointer leaves the hover region. It will
only apply when resetOnExit is true.
final
- resetDuration → Duration
-
How long it should take the widget to reset when the pointer
leaves the hover region.
final
- resetOnExit → bool
-
Whether the animation should reset to the default position when
the pointer leaves the hover region.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- touchBased → bool
-
Whether the parallax stack should listen to touches instead of
hover events.
final
- useLocalPosition → bool
-
Whether the parallax should be referenced from the size and position
of the ParallaxStack. If it is false, the Parallax will be measured
based on the width and height of the screen. Otherwise, it will be
measured based on the size of the ParallaxStack. It is recommended
to set this to true.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _ParallaxStackState -
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