SizeAnimatedWidget.tween constructor

SizeAnimatedWidget.tween({
  1. Duration duration = const Duration(milliseconds: 500),
  2. Duration delay = const Duration(milliseconds: 500),
  3. Size sizeEnabled = const Size(100, 100),
  4. Size sizeDisabled = const Size(0, 0),
  5. bool enabled = true,
  6. dynamic animationFinished(
    1. bool
    )?,
  7. Curve curve = Curves.linear,
  8. required Widget child,
})

An size 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

sizeDisabled : the default value of the widget sizeEnabled : the animated value of the widget

animationFinished : a callback called when the animation is finished

Implementation

SizeAnimatedWidget.tween({
  Duration duration = const Duration(milliseconds: 500),
  Duration delay = const Duration(milliseconds: 500),
  Size sizeEnabled = const Size(100, 100),
  Size sizeDisabled = const Size(0, 0),
  bool enabled = true,
  Function(bool)? animationFinished,
  Curve curve = Curves.linear,
  required Widget child,
}) : this(
        duration: duration,
        enabled: enabled,
        curve: curve,
        child: child,
        delay: delay,
        animationFinished: animationFinished,
        values: [sizeDisabled, sizeEnabled],
      );