create static method

DialerAnimation create({
  1. required TickerProvider vsync,
  2. Duration duration = const Duration(milliseconds: 250),
})

Factory to create the dialer animation set.

Implementation

static DialerAnimation create({
  required TickerProvider vsync,
  Duration duration = const Duration(milliseconds: 250),
}) {
  final AnimationController controller =
      AnimationController(vsync: vsync, duration: duration);
  final CurvedAnimation curve = CurvedAnimation(
    parent: controller,
    curve: Curves.easeOutCubic,
    reverseCurve: Curves.easeInCubic,
  );
  final Animation<double> fade = Tween<double>(begin: 0, end: 1).animate(curve);
  final Animation<double> scale = Tween<double>(begin: 0.9, end: 1).animate(curve);
  final Animation<double> fabRotation = Tween<double>(begin: 0, end: 45 / 360).animate(curve);

  return DialerAnimation._(
    controller: controller,
    fade: fade,
    scale: scale,
    fabRotation: fabRotation,
  );
}