GlassMotionConstants class
Motion constants for .interactive() and glassId morphs.
- Annotations
Constructors
- GlassMotionConstants({required double pressGrowthArea, required double pressScaleMax, required double pressStretch, required double glowRadius, required double pressResponse, required double pressDamping, required double releaseResponse, required double releaseDamping, required double morphResponse, required double morphDamping, double dragStretch = 0.08, double dragStretchDistance = 60})
-
Creates motion constants.
const
-
GlassMotionConstants.fromJson(Map<
String, Object?> j, GlassMotionConstants base) -
Reads keys present in
j; missing keys come frombase.factory
Properties
- dragStretch → double
-
Largest extra scale along an axis when the finger is dragged past the
pressed shape's edge on that axis: the shape rubber-bands toward the
finger, its opposite edge anchored. Estimated by eye from iOS 26
buttons, not measured.
final
- dragStretchDistance → double
-
Drag distance (pt) past the edge at which the stretch reaches
1 − 1/e(63 %) of dragStretch; further drags add less and less. Estimated, not measured.final - glowRadius → double
-
Radius of the touch glow.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- morphDamping → double
-
SwiftUI damping fraction for morphs.
final
- morphResponse → double
-
SwiftUI spring response for morphs.
final
- pressDamping → double
-
SwiftUI damping fraction for the press-in.
final
- pressGrowthArea → double
-
Area (pt²) a pressed shape gains at full press: its uniform scale is
sqrt(1 + pressGrowthArea / (w·h)), capped at pressScaleMax, so small shapes grow more than large ones.final - pressResponse → double
-
SwiftUI spring response for the press-in.
final
- pressScaleMax → double
-
Largest uniform press scale.
final
- pressStretch → double
-
Extra scale along the touch direction at full press.
final
- releaseDamping → double
-
SwiftUI damping fraction for the release.
final
- releaseResponse → double
-
SwiftUI spring response for the release.
final
- 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
-
toJson(
) → Map< String, double> - JSON form.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override