BloomAnimation class

Immutable CSS animation descriptor defining @keyframes rules and timing properties.

Generates CSS keyframe definitions and the shorthand inline animation style string.

Backend Behavior

  • Browser (mount.dart): When an Animated node is mounted, the @keyframes block is created as a <style> element and appended to document.head. Injection is deduplicated by name for the lifetime of the page.
  • SSR (html.dart): Emits a <style> block containing the @keyframes definition on first occurrence (deduplicated by name per render pass) and wraps the child in a <div> carrying the computed animation inline style.
const pulse = BloomAnimation(
  name: 'custom-pulse',
  duration: Duration(milliseconds: 500),
  iterations: -1, // infinite
  easing: 'ease-in-out',
  keyframes: [
    BloomKeyframe(offset: 0.0, styles: {'transform': 'scale(1)'}),
    BloomKeyframe(offset: 0.5, styles: {'transform': 'scale(1.08)'}),
    BloomKeyframe(offset: 1.0, styles: {'transform': 'scale(1)'}),
  ],
);

Constructors

BloomAnimation({required String name, required List<BloomKeyframe> keyframes, Duration duration = const Duration(milliseconds: 300), Duration delay = Duration.zero, int iterations = 1, String easing = 'ease', String fillMode = 'both', String direction = 'normal'})
Creates a new immutable BloomAnimation descriptor.
const

Properties

delay → Duration
Delay before the animation commences. Defaults to Duration.zero.
final
direction → String
CSS animation-direction (e.g. 'normal', 'reverse', 'alternate'). Defaults to 'normal'.
final
duration → Duration
Total duration of one animation cycle. Defaults to 300 milliseconds.
final
easing → String
CSS easing timing function (e.g. 'ease', 'linear', 'cubic-bezier(...)'). Defaults to 'ease'.
final
fillMode → String
CSS animation-fill-mode (e.g. 'both', 'forwards', 'backwards'). Defaults to 'both'.
final
hashCode → int
The hash code for this object.
no setterinherited
iterations → int
Number of iterations to play. Use -1 for infinite repeating (infinite). Defaults to 1.
final
keyframes → List<BloomKeyframe>
Ordered list of BloomKeyframe stops.
final
name → String
The CSS animation identifier used in @keyframes and the animation shorthand property.
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
toInlineStyle() → String
Returns the CSS animation shorthand value formatted for an inline style attribute.
toKeyframesCSS() → String
Returns the complete @keyframes <name> { ... } CSS block.
toString() → String
A string representation of this object.
inherited

Operators

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