initAnimation method

void initAnimation({
  1. TickerProvider? ticker,
})

Initializes the animation controller and offset animation for lateral menu.

ticker is required for vsync, providing the TickerProvider for animations.

Implementation

void initAnimation({TickerProvider? ticker}) {
  if (ticker == null) {
    return;
  }
  _animationController = AnimationController(
    vsync: ticker,
    duration: const Duration(seconds: 1),
  );

  _offsetAnimation = Tween<Offset>(
    begin: const Offset(-1, 0),
    end: Offset.zero,
  ).animate(
    CurvedAnimation(
      parent: _animationController,
      curve: Curves.easeInOut,
    ),
  );
  _animationController.forward();
}