DesignMotionPolicy class
The Reduce Motion policy: which spring a component actually runs.
Under Reduce Motion (designReduceMotionOf) every SPATIAL spring — one that moves, resizes or reshapes something — is critically damped: ζ = 1 at the token's stiffness, so nothing overshoots or bounces and it still arrives on the token's timescale. EFFECTS springs (opacity, colour) become a short fade: critically damped at no less than reducedEffectsStiffness, so a fade or a colour change settles within 150 ms and nothing lingers, without being cut to an instant change (an instant change reads as a flash). A token already faster keeps its stiffness.
controller.springTo(1, DesignMotionPolicy.of(context).spatial(dampingRatio: 0.6, stiffness: 800))
- Annotations
Constructors
- DesignMotionPolicy({bool reduceMotion = false})
-
Creates a DesignMotionPolicy.
const
- DesignMotionPolicy.of(BuildContext context)
-
The policy in force at
context: Reduce Motion when the reader asked for it, on any platform (designReduceMotionOf);contextbuilds again when that changes.factory
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
- reduceMotion → bool
-
Whether the reader asked for reduced motion.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
effects(
{required double dampingRatio, required double stiffness}) → SpringDescription - The spring an effects token (ζ, k) runs under this policy: the token's own, or under Reduce Motion a short fade, critically damped (ζ = 1) at k or reducedEffectsStiffness, whichever is stiffer.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
spatial(
{required double dampingRatio, required double stiffness}) → SpringDescription - The spring a spatial token (ζ, k) runs under this policy: the token's own, or critically damped (ζ = 1, same k) under Reduce Motion.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Constants
- reducedEffectsStiffness → const double
- The least stiffness an effects spring runs at under Reduce Motion: critically damped at k = 3800 (Material's fastest effects token), a spring settles within designSpringTolerance in 150 ms.