TranslateTween class

A widget that animates its position from a beginning offset to an ending offset.

The TranslateTween widget takes a child widget and animates its position over a specified duration. You can customize the duration, delay, curve, and offset values for the animation. Additionally, you can control whether the animation reverses or not.

{@tool snippet} This example shows how to use the TranslateTween widget with a child widget:

TranslateTween(
  child: Text('Slide me!'),
  duration: Duration(seconds: 1),
  curve: Curves.easeInOut,
  begin: Offset(0, 30),
  end: Offset(0, 0),
  reverse: false,
)

{@end-tool}

Inheritance

Constructors

TranslateTween({Key? key, required Widget child, Duration duration = const Duration(milliseconds: 250), Duration reverseDuration = const Duration(milliseconds: 250), Duration delay = const Duration(milliseconds: 0), Curve curve = Curves.linear, Curve reverseCurve = Curves.linear, Offset begin = const Offset(0, 30), Offset end = const Offset(0, 0), bool reverse = false})
Creates a TranslateTween widget.
const

Properties

begin Offset
The beginning offset value of the animation.
final
child Widget
The child widget to be animated.
final
curve Curve
The curve to be used for the slide animation.
final
delay Duration
The delay before the animation starts.
final
duration Duration
The duration of the slide animation.
final
end Offset
The ending offset value 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
reverse bool
Whether the animation should reverse.
final
reverseCurve Curve
The curve used for the reverse animation.
final
reverseDuration Duration
The duration of the reverse animation.
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<TranslateTween>
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