Animation class final
The one unit of motion: everything visual — transforms, opacity, color,
and pixel post-effects — is an Animation in the same .animate([...])
list.
An animation pairs what changes (its effect) with when it plays:
the phase within the element's window, the timing (tween or spring),
a delay, and a Trigger. It deliberately shadows Flutter's Animation;
library code needing Flutter's imports it with a prefix.
Text('Hi').animate([Animation.from(const Keyframe(opacity: 0, y: 0.3))]);
- Annotations
Constructors
- Animation.along(Path path, {bool orient = true, AnimationPhase? phase, Time? duration, Curve? ease, Spring? spring, Time delay = Time.zero, Trigger at = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label})
-
Travels along
path(logical px from the natural position);orientrotates the child to face the direction of travel. Defaults to an enter. - Animation.custom(AnimationEffect effect, {AnimationPhase? phase, Time? duration, Curve? ease, Spring? spring, Time delay = Time.zero, Trigger at = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label})
-
Wraps your own AnimationEffect; defaults to an enter.
const
- Animation.from(Keyframe from, {AnimationPhase? phase, Time? duration, Curve? ease, Spring? spring, Time delay = Time.zero, Trigger at = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label})
-
Animates from
fromto the natural state — an enter. - Animation.fromTo(Keyframe from, Keyframe to, {AnimationPhase? phase, Time? duration, Curve? ease, Spring? spring, Time delay = Time.zero, Trigger at = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label})
-
Animates from
fromtoto; defaults to an enter unlessphasesays otherwise. -
Animation.keyframes(List<
Keyframe> stops, {List<Curve> ? easings, List<Time> ? at, AnimationPhase? phase, Time? duration, Curve? ease, Spring? spring, Time delay = Time.zero, Trigger trigger = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label}) -
Travels through
stopsin order; defaults to an enter. - Animation.to(Keyframe to, {AnimationPhase? phase, Time? duration, Curve? ease, Spring? spring, Time delay = Time.zero, Trigger at = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label})
-
Animates from the natural state to
to— an exit.
Properties
- at → Trigger
-
Relative to what it starts; defaults to Trigger.auto.
final
- delay → Time
-
Offset applied after the trigger fires; defaults to Time.zero.
final
- duration → Time?
-
How long it runs;
nullinherits the mergedDefaultsduration. Ignored when spring is set.final - ease → Curve?
-
The curve shaping progress;
nullinherits the mergedDefaultsease. Ignored when spring is set.final - effect → AnimationEffect
-
What this animation does to its target — built-in or custom.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- label → String?
-
Names this animation so others can chain off it; diagnostics only.
final
- phase → AnimationPhase
-
When it plays within the element's window: enter, exit, or during.
Inferred —
from→ enter,to→ exit, continuous presets → during.final - repeat → Repeat?
-
Loops the animation inside its span;
nullplays a single pass.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- spring → Spring?
-
Physics-driven timing; when set it wins over duration/ease and the
settle time becomes the animation's span.
final
- stagger → Stagger?
-
Distributes start offsets across a multi-child target;
nullinherits.final - timing → Timing?
-
The anatomy view of the three timing fields: spring wins; an explicit
duration makes a Tween (with ease or
Ease.smooth); all-unset isnull, deferring to the inheritedDefaults.no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
bloom(
double amount, {Time? duration, Curve? ease, Spring? spring, Time delay = Time.zero, Trigger at = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label}) → Animation - Bleeds a soft glow out of the element's bright areas — a pixel post-effect.
-
blurIn(
{double sigma = 12, Time? duration, Curve? ease, Spring? spring, Time delay = Time.zero, Trigger at = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label}) → Animation -
Sharpens in from a gaussian blur of
sigmalogical pixels — an enter. -
blurOut(
{double sigma = 12, Time? duration, Curve? ease, Spring? spring, Time delay = Time.zero, Trigger at = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label}) → Animation -
Blurs out to a gaussian blur of
sigmalogical pixels — an exit. -
chromatic(
double px, {Time? duration, Curve? ease, Spring? spring, Time delay = Time.zero, Trigger at = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label}) → Animation -
Splits the red/blue channels by
pxlogical pixels for a lens-fringe aberration — a pixel post-effect. -
color(
{required Color to, Time? duration, Curve? ease, Spring? spring, Time delay = Time.zero, Trigger at = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label}) → Animation -
Tints toward
toat the end of the window — color as data, an exit. -
drift(
{Edge to = Edge.right, double distance = 0.1, Time delay = Time.zero, Trigger at = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label}) → Animation -
Drifts toward the
toedge across the whole window — a slow one-pass ambient slide. -
fadeIn(
{Time? duration, Curve? ease, Spring? spring, Time delay = Time.zero, Trigger at = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label}) → Animation - Fades in from fully transparent to the natural opacity — an enter.
-
fadeOut(
{Time? duration, Curve? ease, Spring? spring, Time delay = Time.zero, Trigger at = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label}) → Animation - Fades out from the natural opacity to fully transparent — an exit.
-
float(
{double amplitude = 0.04, double frequency = 0.4, String? seed, Time delay = Time.zero, Trigger at = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label}) → Animation - Floats gently up and down forever — a continuous ambient motion.
-
glitchIn(
{Edge from = Edge.left, Time? duration, Curve? ease, Spring? spring, Time delay = Time.zero, Trigger at = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label}) → Animation - Glitches in: a brief digital tear that resolves to the natural frame — a pixel post-effect, an enter.
-
gradientShift(
{required List< Color> to, Time? duration, Curve? ease, Spring? spring, Time delay = Time.zero, Trigger at = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label}) → Animation -
Shifts the enclosing
Background.gradient/radialtowardto— an enter, start-anchored so relativedelay/durationarithmetic holds andTrigger.afterfires when the shift completes. -
grain(
double amount, {Time? duration, Curve? ease, Spring? spring, Time delay = Time.zero, Trigger at = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label}) → Animation - Lays seeded monochrome film grain over the element — a pixel post-effect.
-
kenBurns(
{double zoom = 1.15, Edge pan = Edge.left, Time delay = Time.zero, Trigger at = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label}) → Animation -
Slowly zooms to
zoomwhile panning toward thepanedge — the classic Ken Burns documentary move, one pass across the window. -
maskWipe(
{WipeShape shape = WipeShape.circle, Alignment origin = Alignment.center, Time? duration, Curve? ease, Spring? spring, Time delay = Time.zero, Trigger at = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label}) → Animation -
Reveals the element through a growing
shapemask — an enter. -
parallax(
{double depth = 0.2, Time? duration, Curve? ease, Spring? spring, Time delay = Time.zero, Trigger at = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label}) → Animation -
Drifts the element by
depthacross the scene for a parallax layer — a transform-class effect. -
particles(
Particles spec, {Time? duration, Curve? ease, Spring? spring, Time delay = Time.zero, Trigger at = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label}) → Animation - Lays a deterministic field of particles over the element — a pixel post-effect.
-
pop(
{double overshoot = 1.1, Spring? spring, Time? duration, Curve? ease, Time delay = Time.zero, Trigger at = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label}) → Animation -
Pops in from scale
0on a spring — an enter, springy by default. -
pulse(
{AudioBand? on, double gain = 1.0, Anchor? track, double min = 0.97, double max = 1.03, Time period = const Time.seconds(1.2), Time delay = Time.zero, Trigger at = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label}) → Animation - Breathes scale forever — a continuous ambient pulse, in two forms.
-
scaleIn(
{double from = 0.85, Spring? spring, Time? duration, Curve? ease, Time delay = Time.zero, Trigger at = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label}) → Animation -
Scales in from
from(a scale factor,1= natural size) — an enter on Spring.snappy by default. -
scaleY(
{required AudioBand on, double gain = 1.0, Anchor? track, Time delay = Time.zero, Trigger at = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label}) → Animation -
Scales the element's height by an audio band's energy forever — a
spectrum-reactive
duringanimation. -
scanlines(
{Time? duration, Curve? ease, Spring? spring, Time delay = Time.zero, Trigger at = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label}) → Animation - Overlays thin dark horizontal lines for a CRT/VHS look — a pixel post-effect taking no required parameter.
-
shader(
String asset, {Map< String, Object> uniforms = const {}, Time? duration, Curve? ease, Spring? spring, Time delay = Time.zero, Trigger at = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label}) → Animation - Paints a custom fragment shader over the element — an experimental pixel post-effect.
-
slideFade(
{Edge from = Edge.bottom, Time? duration, Curve? ease, Spring? spring, Time delay = Time.zero, Trigger at = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label}) → Animation -
Slides in from the
fromedge while fading in — an enter. -
slideIn(
{Edge from = Edge.bottom, Time? duration, Curve? ease, Spring? spring, Time delay = Time.zero, Trigger at = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label}) → Animation -
Slides in from one element-size off the
fromedge — an enter. -
slideOut(
{Edge to = Edge.top, Time? duration, Curve? ease, Spring? spring, Time delay = Time.zero, Trigger at = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label}) → Animation -
Slides out to one element-size off the
toedge — an exit. -
spin(
{Time per = const Time.seconds(4), Time delay = Time.zero, Trigger at = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label}) → Animation -
Spins one full turn every
perforever — a continuous rotation. -
vignette(
double amount, {Time? duration, Curve? ease, Spring? spring, Time delay = Time.zero, Trigger at = Trigger.auto, Stagger? stagger, Repeat? repeat, String? label}) → Animation - Darkens the edges toward the center — a pixel post-effect.