GradientEffect class

Sweeps a multi-color gradient across the text over time.

Each character is tinted with a color from colors, animated so the gradient shifts horizontally (or vertically) as progress increases. Creates a flowing rainbow or brand-colored sweep effect.

Inheritance

Constructors

GradientEffect({Duration duration = const Duration(milliseconds: 2000), Curve curve = Curves.linear, List<Color> colors = const [Colors.blue, Colors.purple, Colors.pink], Axis direction = Axis.horizontal, Duration delayBetweenChars = Duration.zero})
Creates a gradient sweep animation across characters.
const

Properties

colors List<Color>
Ordered list of colors for the gradient sweep.
final
curve Curve
Curve applied to the animation timing for easing.
finalinherited
delayBetweenChars Duration
Delay between each successive character's animation start.
finalinherited
direction Axis
Direction of the gradient sweep (horizontal or vertical).
final
duration Duration
Total duration of one full animation cycle for a single character.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

applyCurve(double t) double
Applies the effect's curve to a linear value t (0.0–1.0).
inherited
getAnimations(double progress, int charCount) List<CharacterAnimation>
Generates per-character animations by shifting the gradient position based on progress so the color band sweeps across the text.
override
getTotalDuration(int charCount) Duration
Returns the total duration needed to animate all charCount characters.
override
noise(int index, [int offset = 0]) double
Returns a deterministic pseudo-random value (0.0–1.0) for the given index and optional offset.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
staggeredProgress(double globalProgress, int index, int charCount) double
Computes the per-character progress for staggered animations.
inherited
toString() String
A string representation of this object.
inherited

Operators

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