createTweens method

  1. @override
void createTweens()

Build the animations driven by controller. Called from initState after controller has been created.

Implementation

@override
void createTweens() {
  _opacity = TweenSequence<double>(<TweenSequenceItem<double>>[
    TweenSequenceItem(tween: Tween(begin: 0, end: 1), weight: 60),
    TweenSequenceItem(tween: Tween(begin: 1, end: 1), weight: 40),
  ]).animate(
    CurvedAnimation(
      parent: controller,
      curve: const Interval(0, 0.6, curve: Curves.easeInOut),
    ),
  );

  _scale = TweenSequence<double>(<TweenSequenceItem<double>>[
    TweenSequenceItem(tween: Tween(begin: 0.1, end: 0.475), weight: 60),
    TweenSequenceItem(tween: Tween(begin: 0.475, end: 1.0), weight: 40),
  ]).animate(
    CurvedAnimation(
      parent: controller,
      curve: const Interval(0, 1, curve: _easeOutBack),
    ),
  );

  _translate = TweenSequence<double>(<TweenSequenceItem<double>>[
    TweenSequenceItem(tween: Tween(begin: widget.from, end: 60), weight: 60),
    TweenSequenceItem(tween: Tween(begin: 60.0, end: 0.0), weight: 40),
  ]).animate(
    CurvedAnimation(
      parent: controller,
      curve: const Interval(0, 1, curve: _easeOutBack),
    ),
  );
}