MirrorAnimation<T> class
Widget that creates and plays an animation endlessly from the start to the end, then reverse to the start, then again to the end and so on.
You need to specify a tween that describes your animation and builder function that is called each frame you are animating. This function has signature of AnimatedWidgetBuilder.
It's also useful to specify a duration (default is 1 second).
To improve the performance of your animation you should put all widgets that are not effected by the animation into the child property. You get that child widget passed into the builder function. See also AnimatedWidgetBuilder.
The curve parameter can be used to apply a non-linear animation to your tween.
You can optionally limit the framerate (fps) of the animation by setting the fps value.
If you work with multiple animation widgets that are conditionally rendered, you might want to set a key. Otherwise Flutter will recycled your "old animation" which results in strange behavior.
You can connect this widget to the closest AnimationDeveloperTools
by setting developerMode to true
.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- MirrorAnimation
Constructors
-
MirrorAnimation({required AnimatedWidgetBuilder<
T> builder, required Animatable<T> tween, Duration duration = const Duration(seconds: 1), Curve curve = Curves.linear, Widget? child, int? fps, bool developerMode = false, Key? key}) -
Creates a new MirrorAnimation widget.
See class documentation for more information.
const
Properties
-
builder
→ AnimatedWidgetBuilder<
T> -
final
- child → Widget?
-
final
- curve → Curve
-
final
- developerMode → bool
-
final
- duration → Duration
-
final
- fps → int?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
tween
→ Animatable<
T> -
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's 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, 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