UiMotionSpec class

A complete, theme-resolved contract for an interruptible transition.

Open UI components use this instead of hard-coded durations and curves. External consumers can resolve the same contract with resolve, configure their controller with configure, and transform its progress with transform.

Annotations

Constructors

UiMotionSpec({required Duration duration, required Duration reverseDuration, required Curve curve, required Curve reverseCurve})
const
UiMotionSpec.fromTokens(UiMotionTokens tokens, {UiMotionSpeed duration = UiMotionSpeed.standard, UiMotionSpeed reverseDuration = UiMotionSpeed.fast, Curve? curve, Curve? reverseCurve})
factory
UiMotionSpec.resolve(BuildContext context, {UiMotionSpeed duration = UiMotionSpeed.standard, UiMotionSpeed reverseDuration = UiMotionSpeed.fast, Curve? curve, Curve? reverseCurve})
Resolves timing and easing from the active Open UI theme.
factory
UiMotionSpec.resolveCustom(BuildContext context, {required Duration duration, Duration? reverseDuration, Curve? curve, Curve? reverseCurve})
Resolves explicit authored timing while preserving reduced-motion behavior. Prefer resolve when semantic speed tokens are sufficient.
factory
UiMotionSpec.resolveTiming(BuildContext context, {UiMotionDuration duration = UiMotionDuration.standard, UiMotionDuration reverseDuration = UiMotionDuration.fast, Curve? curve, Curve? reverseCurve})
Resolves token-or-custom duration values into one motion contract.
factory

Properties

curve Curve
final
duration Duration
final
hashCode int
The hash code for this object.
no setterinherited
isReduced bool
no setter
reverseCurve Curve
final
reverseDuration Duration
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

configure(AnimationController controller) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
transform(double value, {required bool reversing}) double
Applies the correct curve for the controller's current direction.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

resolveDuration(UiMotionTokens tokens, UiMotionSpeed speed) Duration
Resolves a semantic speed against a concrete motion-token set.