SparkleEffect class
A particle-based sparkle effect that flashes bright icons inside the widget bounds.
- Inheritance
-
- Object
- TuiAnimationEffect
- SparkleEffect
Constructors
-
SparkleEffect({required Duration duration, EasingFunction easing = Easing.linear, int density = 2, List<
Color> colors = const [Colors.yellow, Colors.white, CharmColors.lichen], List<String> sparkleChars = const ['✦', '✧', '*', '+', '.']}) - Creates a SparkleEffect with config for duration, easing, particle density, colors, and characters.
Properties
-
colors
→ List<
Color> -
The list of colors to pick particle styles from.
final
- density → int
-
The number of particle generation attempts per frame.
final
- duration → Duration
-
Total duration of the animation lifecycle.
finalinherited
- easing → EasingFunction
-
Easing curve applied to progress over time.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isActive → bool
-
Whether the animation is currently active (for backward compatibility).
no setterinherited
- isAnimating → bool
-
Whether the animation is currently running/animating (status is forward or reverse).
no setterinherited
- isVisible → bool
-
Whether the animation is visible (status is not dismissed).
no setterinherited
- onUpdate ↔ VoidCallback?
-
The callback to trigger widget repaints.
getter/setter pairinherited
- progress ↔ double
-
The eased progress of the animation, bounded strictly between
0.0and1.0.getter/setter pairinherited - rawProgress → double
-
The raw (uneased) progress of the animation, bounded strictly between
0.0and1.0.no setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
sparkleChars
→ List<
String> -
The list of characters used to represent sparkles.
final
- status ↔ AnimationStatus
-
The current status of the animation.
getter/setter pairinherited
- targetFrameInterval → Duration
-
The target frame interval (e.g. Duration(milliseconds: 33) for 30 FPS).
If set, the effect will throttle its repaint triggers to this interval.
Defaults to Duration.zero (render on every tick/vsync).
finalinherited
-
triggerPoint
↔ Point<
int> ? -
The local coordinate where the animation was triggered.
getter/setter pairinherited
Methods
-
forward(
) → void -
Starts running this animation forward.
inherited
-
interpolateColor(
Color c1, Color c2, double t) → Color -
Helper utility to interpolate between two discrete Color properties.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
paint(
Buffer buffer, Rect area, Style baseStyle) → void -
Performs direct rendering modifications to the relative
buffer.override -
reset(
) → void -
Resets the animation to its default dormant/dismissed state.
inherited
-
reverse(
) → void -
Starts running this animation in reverse.
inherited
-
start(
Point< int> clickPoint, VoidCallback onUpdate) → void -
Starts the animation forward from the beginning.
override
-
stop(
) → void -
Stops the animation and freezes it at the current progress.
inherited
-
tick(
) → bool -
Advances the animation tick frame. Returns true if ticking should continue.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited