Transition class final

How a change of property animates (Flutter's implicit animations: AnimatedContainer(duration:, curve:), AnimatedOpacity, AnimatedScale, TweenAnimationBuilder): when the value there changes (a binding, a condition, a state style), the node tweens from what it shows to the new value over duration after delay on curve, or on spring. A change mid-flight carries on from where it is. A behavior key, a list: "transitions": [{"property": "motion", "duration": 240, "curve": "easeOutCubic"}, {"property": "opacity", "duration": 120}].

property is a binding path or a prefix of one; the longest that matches wins (motion.rotate over motion), * matches every path. A prefix eases what's under it as one value, as AnimatedContainer does its transform: a change of any of its numbers starts them together, and keyframes are passed through each time. A path an animation track is playing isn't transitioned. The design canvas shows new values at once.

Annotations
  • @immutable

Constructors

Transition({String property = '', int duration = 0, int delay = 0, AnimationCurve curve = AnimationCurve.linear, Spring? spring, List<Keyframe> keyframes = const [], KeyframeInterpolation interpolation = KeyframeInterpolation.linear})
const

Properties

curve → AnimationCurve
final
delay → int
Milliseconds.
final
duration → int
Milliseconds.
final
hashCode → int
The hash code for this object.
no setterinherited
interpolation → KeyframeInterpolation
final
keyframes → List<Keyframe>
Values passed through on the way (Keyframes, at 0–1 of the run): a number for a single property; for a prefix, an object of the numbers under it ({"at": 0.5, "value": {"scale": 1.05}}: a card that swells as it turns over). Joined as interpolation says.
final
property → String
The binding path (or prefix) it eases: motion, motion.rotate, opacity, decoration.fills, layout, visible, *.
final
props → List<Object?>
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
spring → Spring?
Eases on this spring instead of duration and curve.
final

Methods

keyframesOf(String key) → List<Keyframe>
The values keyframes give key (a number under a prefix, or the property's own when it has no prefix).
matches(String path) → bool
Whether it eases binding path path.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Json
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

fromJson(Object? json, {String? property}) → Transition?
listFromJson(Object? json) → List<Transition>
A node's transitions (a list; anything else is none).
of(List<Transition> list, String path) → Transition?
The transition of list that eases path: the longest match.