AnimationStagger class

A utility class that manages staggered animations by incrementing durations.

The AnimationStagger class is designed to help create staggered animation effects by providing incrementally increasing durations for animations.

Example usage:

final stagger = AnimationStagger(Duration(milliseconds: 200));
print(stagger[1]); // 200ms
print(stagger + 2); // 600ms
print(stagger.add()); // 600ms (index = 3)

Constructors

AnimationStagger([Duration increment = const Duration(milliseconds: 100)])
Creates an AnimationStagger with an optional increment.

Properties

hashCode → int
The hash code for this object.
no setterinherited
increment → Duration
The duration increment applied between each staggered animation.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

add() → Duration
Returns the current stagger duration and then increments the internal index.
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 +(int value) → Duration
Advances the internal index by value and returns the new duration.
operator ==(Object other) → bool
The equality operator.
inherited
operator [](int index) → Duration
Returns the duration for the animation at the given index.