OpacityAnimatedWidget.tween constructor

OpacityAnimatedWidget.tween({
  1. Duration duration = const Duration(milliseconds: 500),
  2. double opacityEnabled = 1,
  3. double opacityDisabled = 0,
  4. bool enabled = true,
  5. dynamic animationFinished(
    1. bool
    )?,
  6. Curve curve = Curves.linear,
  7. required Widget child,
})

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]);