RepeatingAnimationBuilder<T extends Object> class
Widget that animates an Animatable value and repeats indefinitely.
The animation continuously cycles from the value produced by the Animatable at 0.0 to the value at 1.0. The builder receives the current value produced by this Animatable and builds the child from it. When the animation reaches 1.0, it either restarts from 0.0 or reverses direction, based on the configured repeatMode. When paused is true, the animation stops at its current value.
To create a local project with this code sample, run:
flutter create --sample=widgets.RepeatingAnimationBuilder.1 mysample
For more complex, stateful, or coordinated animations, consider managing an AnimationController directly and composing it with AnimatedBuilder or an AnimatedWidget.
See also:
- TweenAnimationBuilder, which animates a tween value once.
- AnimationController.repeat, the underlying mechanism.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- RepeatingAnimationBuilder
Constructors
-
RepeatingAnimationBuilder({Key? key, required Animatable<
T> animatable, required Duration duration, Curve curve = Curves.linear, RepeatMode repeatMode = RepeatMode.restart, bool paused = false, required ValueWidgetBuilder<T> builder, Widget? child}) -
Creates a widget that repeats an animation.
const
Properties
-
animatable
→ Animatable<
T> -
The animatable to drive repeatedly.
final
-
builder
→ ValueWidgetBuilder<
T> -
A builder that creates the animated widget subtree.
final
- child → Widget?
-
An optional widget to pass to the builder.
final
- curve → Curve
-
The curve applied to the animation input before it is passed to the
animatable.
final
- duration → Duration
-
The duration of the animation.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- paused → bool
-
Whether the animation is currently paused.
final
- repeatMode → RepeatMode
-
How the animation behaves after reaching 1.0.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< RepeatingAnimationBuilder< T> > -
Creates the mutable state for this widget at a given location in the tree.
override
-
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, int wrapWidth = 65}) → 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