PanelMotionSpec class final
Every tunable that decides how the panel moves.
Springs are authored with SpringDescription.withDurationAndBounce because duration-and-bounce is the model designers reason in; mass, stiffness, and damping are derived from it.
- Annotations
Constructors
- PanelMotionSpec({SpringDescription? snapSpring, SpringDescription? morphSpring, Tolerance tolerance = kPanelTolerance, double decelerationRate = kPanelNormalDecelerationRate, double rubberBandCoefficient = kPanelRubberBandCoefficient, Duration momentumHalfLife = const Duration(milliseconds: 100), Duration contentFadeDuration = Duration.zero, double stashCommit = 0.25, bool immediate = false, bool reduceMotion = false})
- PanelMotionSpec.instant()
- Motion suppressed entirely: geometry snaps and content swaps at once.
- PanelMotionSpec.reduced()
- The reduced-motion variant used when MediaQueryData.disableAnimations is set: geometry snaps, but content still cross-fades.
Properties
- contentFadeDuration → Duration
-
How long collapsed and expanded content cross-fade when reduceMotion.
final
- decelerationRate → double
-
Deceleration used to project where a fling would land.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- immediate → bool
-
Whether settles complete instantly instead of running a simulation.
final
- momentumHalfLife → Duration
-
How quickly momentum captured from an interrupted settle decays.
final
- morphSpring → SpringDescription
-
Drives expansion progress between collapsed and expanded.
final
- reduceMotion → bool
-
Whether to honour a reduced-motion preference.
final
- rubberBandCoefficient → double
-
Resistance constant for dragging beyond the bounds.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- skipPositionAnimation → bool
-
Whether position changes should complete without a simulation.
no setter
- snapSpring → SpringDescription
-
Carries the panel to a resting placement after a drag.
final
- stashCommit → double
-
How far past its resting edge the panel must project to park there, as a
fraction of the panel's width.
final
- tolerance → Tolerance
-
When a simulation is close enough to its target to stop.
final
Methods
-
copyWith(
{SpringDescription? snapSpring, SpringDescription? morphSpring, Tolerance? tolerance, double? decelerationRate, double? rubberBandCoefficient, Duration? momentumHalfLife, Duration? contentFadeDuration, double? stashCommit, bool? immediate, bool? reduceMotion}) → PanelMotionSpec -
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
Static Methods
-
lerp(
PanelMotionSpec? a, PanelMotionSpec? b, double t) → PanelMotionSpec? - Interpolates between two specs, switching over at the midpoint.