UiContourPhysics class

A tokenized amplitude family for Open UI Kit's restrained material motion.

This governs only optional, decorative surface deformation layered on top of geometry that is already correct — never the geometry timeline itself. An earlier revision used this to generate the transition Curve; that conflated a physical spring response (calibrated in seconds) with a normalized 0..1 progress fraction, which made the curve saturate within the first ~15% of any duration regardless of tuning — a snap-then-idle bug, not a tuning problem. Geometry progress now always uses a plain, restrained curve resolved from UiMotionSpec (see UiContourController); UiContourPhysics is reserved for a future velocity-derived deformation layer, applied only to decorative surface transforms and never to layout bounds (see doc/contour.md).

Do not construct ad hoc instances at call sites. Use control, surface, or chrome, or resolve a component-appropriate preset through UiContourPhysics.resolve.

Annotations

Constructors

UiContourPhysics({required double maxStretch, required double maxCompression, required UiContourOvershootPolicy overshootPolicy, required double settleThreshold})
const

Properties

hashCode int
The hash code for this object.
no setterinherited
maxCompression double
Maximum fractional deformation while settling/closing, clamped.
final
maxStretch double
Maximum fractional deformation past resting geometry while opening, clamped. Decorative only — never applied to layout bounds.
final
overshootPolicy UiContourOvershootPolicy
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
settleThreshold double
The progress value, once reached, past which the response is considered visually settled.
final

Methods

deformationAmplitude(double progress) double
Amplitude (0..1) of decorative deformation for a given transition progress, clamped to maxStretch/maxCompression. Never read this as a layout fraction — it is for a bounded, localized visual transform only (see the class doc).
isSettled(double progress, {required bool opening}) bool
Whether progress has settled per settleThreshold, from either direction (open toward 1, close toward 0).
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

resolve(BuildContext context, UiContourPhysics preset) UiContourPhysics
Resolves the appropriate preset for the current context, collapsing to none under reduced motion or the disabled/accessibility-safe effects tier so decorative deformation never survives those constraints.

Constants

chrome → const UiContourPhysics
Persistent application chrome: navigation bars, tab indicators, destructive/high-stakes confirmation. No deformation.
control → const UiContourPhysics
Small controls: buttons, chips, icon triggers. Low amplitude.
none → const UiContourPhysics
No deformation at all. Used under reduced motion and the disabled/ accessibility-safe effects tier.
surface → const UiContourPhysics
Larger content surfaces: sheets, expanded cards. Calmer than control.