ScaleTween class

A widget that animates its scale from a beginning value to an ending value.

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

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

ScaleTween(
  child: Text('Scale me!'),
  duration: Duration(seconds: 1),
  curve: Curves.easeInOut,
  begin: 0.5,
  end: 1.5,
  reverse: false,
)

{@end-tool}

Inheritance

Constructors

ScaleTween({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, double begin = 0.2, double end = 1.0, bool reverse = false})
Creates a ScaleTween widget.
const

Properties

begin → double
The beginning scale value of the animation.
final
child → Widget
The child widget to be animated.
final
curve → Curve
The curve to be used for the scale animation.
final
delay → Duration
The delay before the animation starts.
final
duration → Duration
The duration of the scale animation.
final
end → double
The ending scale 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<ScaleTween>
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