Reduced motion support for the design system.
Detects system-level reduced motion preferences and provides utilities to disable or minimize animations when requested.
if (ReducedMotion.of(context)) {
// Skip animation
return child;
}
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
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.
inherited
Static Methods
-
animationDuration(
BuildContext context, {Duration? fallback}) → Duration - Returns an animation duration that respects reduced motion.
-
curve(
BuildContext context, {Curve fallback = Curves.easeInOut}) → Curve - Returns a curve that respects reduced motion.
-
duration(
BuildContext context, Duration duration) → Duration - Returns a Duration that respects reduced motion.
-
of(
BuildContext context) → bool - Whether the system or app requests reduced motion.
-
wrap(
{required BuildContext context, required Widget child, required Widget animatedChild}) → Widget - Wraps a child with conditional animation.