OpacityAnimatedWidget.tween constructor
OpacityAnimatedWidget.tween({})
An opacity animation using 2 values : enabled - disabled
duration : the duration of the animation, including intermediate values delay : the delay before the animation starts enabled : determine if the animation is stopped or fired curve : An easing curve, see Curve
opacityDisabled : the default value of the widget (between 1.0 and 0.0) opacityEnabled : the animated value of the widget (between 1.0 and 0.0)
animationFinished : a callback called when the animation is finished
Implementation
OpacityAnimatedWidget.tween({
Duration duration = const Duration(milliseconds: 500),
double opacityEnabled = 1,
double opacityDisabled = 0,
bool enabled = true,
Function(bool)? animationFinished,
Curve curve = Curves.linear,
required Widget child,
}) : this(
duration: duration,
enabled: enabled,
curve: curve,
child: child,
animationFinished: animationFinished,
values: [opacityDisabled, opacityEnabled]);