OpacityTween class
A widget that animates its opacity from a beginning value to an ending value.
The OpacityTween widget takes a child widget and animates its opacity over a specified duration. You can customize the duration, delay, curve, and opacity values for the animation. Additionally, you can control whether the animation reverses or not.
{@tool snippet} This example shows how to use the OpacityTween widget with a child widget:
OpacityTween(
child: Text('Fade me!'),
duration: Duration(seconds: 1),
curve: Curves.easeInOut,
begin: 0.2,
end: 1.0,
reverse: false,
)
{@end-tool}
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- OpacityTween
Constructors
- OpacityTween({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 an OpacityTween widget.
const
Properties
- begin → double
-
The beginning opacity value of the animation.
final
- child → Widget
-
The child widget to be animated.
final
- curve → Curve
-
The curve to be used for the opacity animation.
final
- delay → Duration
-
The delay before the animation starts.
final
- duration → Duration
-
The duration of the opacity animation.
final
- end → double
-
The ending opacity 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< OpacityTween> -
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