CharacterAnimation class
Per-character animation state produced by a TextEffect.
Contains all visual properties that can be animated per character: opacity, translation, scaling, color, blur, rotation, underline, and clip.
Multiple CharacterAnimation instances are combined with combine using well-defined rules:
- opacity, scale, scaleX, scaleY, clipProgress are multiplied
- translation, blurSigma, rotation, rotationX, rotationY, underlineProgress are summed
- color, backgroundColor use last non-null wins
Constructors
- CharacterAnimation({double opacity = 1.0, Offset translation = Offset.zero, double scale = 1.0, double scaleX = 1.0, double scaleY = 1.0, Color? color, Color? backgroundColor, double blurSigma = 0.0, double rotation = 0.0, double rotationX = 0.0, double rotationY = 0.0, double underlineProgress = 0.0, double clipProgress = 1.0, String? character})
-
Creates a CharacterAnimation with all properties defaulting to
identity values (no animation applied).
const
Properties
- backgroundColor → Color?
-
Background color rendered behind the character.
final
- blurSigma → double
-
Gaussian blur sigma (0.0 = no blur).
final
- character → String?
-
Optional character override. When set, this character is displayed
instead of the original text character (e.g. for scramble effects).
final
- clipProgress → double
-
Clip reveal progress from 0.0 (fully hidden) to 1.0 (fully visible).
final
- color → Color?
-
Text color override. If null, the inherited style color is used.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- opacity → double
-
Character opacity (0.0 = transparent, 1.0 = opaque).
final
- rotation → double
-
2D rotation angle in radians around the character's origin.
final
- rotationX → double
-
3D rotation angle in radians around the X axis.
final
- rotationY → double
-
3D rotation angle in radians around the Y axis.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scale → double
-
Uniform scale factor applied before scaleX and scaleY.
final
- scaleX → double
-
Horizontal scale factor applied after scale.
final
- scaleY → double
-
Vertical scale factor applied after scale.
final
- translation → Offset
-
Offset translation applied to the character.
final
- underlineProgress → double
-
Underline draw progress from 0.0 (hidden) to 1.0 (full width).
final
- uniformScale → double
-
Combined horizontal scale factor: scale × scaleX.
no setter
Methods
-
combine(
CharacterAnimation other) → CharacterAnimation -
Merges this animation with
otherusing composition rules. -
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 ==(
Object other) → bool -
The equality operator.
inherited