WxAnimatedText class

This class is used to create animated text widgets in Flutter. It inherits from the WxText class and adds the ability to specify an animation function that controls how the text widget is transformed during the animation cycle.

Inheritance

Constructors

WxAnimatedText({Key? key, int repeat = -1, bool pause = false, bool continuity = true, bool mirror = false, bool reverse = false, AnimatedRepeatableBuilder transition = AnimatedRepeatable.fade, Curve curve = Curves.linear, Duration delay = Duration.zero, Duration duration = const Duration(milliseconds: 200), AnimatedRepeatableBuilder? reverseTransition, Curve? reverseCurve, Duration? reverseDelay, Duration? reverseDuration, AnimatedRepeatableBuilder? wrapper, VoidCallback? onStart, VoidCallback? onPause, VoidCallback? onContinue, ValueSetter<int>? onCycle, VoidCallback? onComplete, required Text child})
Creates an animated text widget.
const

Properties

child Widget
The mandatory widget that will be animated during the transition.
finalinherited
continuity bool
Controls whether the animation should maintain continuity when paused.
finalinherited
curve Curve
The curve of the animation. By default it's Curves.linear.
finalinherited
delay Duration
The delay before the animation starts.
finalinherited
duration Duration
The duration of the animation.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
mirror bool
Defines whether the animation should play forward, then backward in a mirroring effect.
finalinherited
onComplete VoidCallback?
Called when all specified loops have finished playing (if repeat is not set to -1 for infinite loops).
finalinherited
onContinue VoidCallback?
Called when the animation is resumed after being paused.
finalinherited
onCycle ValueSetter<int>?
Called when a complete loop iteration finishes.
finalinherited
onPause VoidCallback?
Called when the animation is paused.
finalinherited
onStart VoidCallback?
Called only once at the very beginning when the animation starts playing for the first time.
finalinherited
pause bool
When set to true, the animation playback is paused. When set to false (default), the animation plays normally according to the defined loop count repeat.
finalinherited
repeat int
Controls how many times the entire animation loop (forward and potentially backward if mirror is true) will be played. Regardless of the repeat value, the animation will always play through one complete cycle (forward and potentially backward) before considering the repeat condition.
finalinherited
reverse bool
When set to true, the animation plays backward initially.
finalinherited
reverseCurve Curve?
The curve to use in the backward direction. (only applicable if mirror is true).
finalinherited
reverseDelay Duration?
The delay before the animation starts playing in the backward direction (only applicable if mirror is true). This allows for a slight pause between the forward and backward animations in the mirroring effect.
finalinherited
reverseDuration Duration?
An optional duration that can be specified for the backward animation (only applicable if mirror is true), allowing for a different duration compared to the forward animation, creating an asymmetrical mirroring effect.
finalinherited
reverseTransition → AnimatedRepeatableBuilder?
Defines the type of animation applied to the child widget for the backward direction (only applicable if mirror is true).
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
transition → AnimatedRepeatableBuilder
Defines the type of animation applied to the child widget. By default, it uses a fade transition (AnimatedRepeatable.fade). You can potentially provide your own custom transition function here.
finalinherited
wrapper → AnimatedRepeatableBuilder?
It allows you to control how the child widget is transformed based on the animation's progress and current state (LoopAnimationStatus).
finalinherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<AnimatedRepeatable>
Creates the mutable state for this widget at a given location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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

Static Methods

shake({Axis direction = Axis.horizontal, double distance = 5}) → AnimatedRepeatableBuilder
Creates a transition builder for that animates text by shaking it horizontally or vertically.
shimmer({required List<Color> colors, List<double>? stops, AlignmentGeometry begin = Alignment.topLeft, AlignmentGeometry end = Alignment.centerRight, TileMode tileMode = TileMode.clamp, AxisDirection direction = AxisDirection.right, BlendMode blendMode = BlendMode.srcATop}) WxAnimatedTextBuilder
Creates a transition builder specifically designed for creating a shimmering effect.
slide(Offset to, [Offset from = Offset.zero]) → AnimatedRepeatableBuilder
Provides a convenient way to create basic sliding animations for your text widget within the WxAnimatedText widget. Control the direction and distance of the slide using the to and from offsets.
typing({String? trails, Duration trailsBlinking = const Duration(milliseconds: 500)}) WxAnimatedTextBuilder
This function is used to create a typing animation for text widgets in the WxAnimatedText class. It simulates the effect of text being typed on screen one character at a time.
zoom([double from = 0, double to = 1]) → AnimatedRepeatableBuilder
Creates a transition builder that produces a zooming effect on the text widget.

Constants

fade → const Widget Function(Widget child, AnimatedRepeatableState state)
Creates a smooth fading effect on the text widget during the animation cycle.
shakeX → const Widget Function(Widget child, AnimatedRepeatableState state)
Animates text by shake them along the horizontal axis.
shakeY → const Widget Function(Widget child, AnimatedRepeatableState state)
Animates text by shake them along the vertical axis.