AnimationOnScrollController constructor

AnimationOnScrollController({
  1. required ScrollController? scrollController,
  2. AnimationDirection direction = AnimationDirection.forward,
  3. double requiredScrollOffset = 32.0,
  4. required TickerProvider vsync,
  5. Duration animationDuration = const Duration(milliseconds: 130),
})

Creates an AnimationOnScrollController.

{@tool snippet} The AnimationOnScrollController needs to be initialized on a StatefulWidget. This can be achieved by initializing the declared object in the State.initState method as stated below:

_animationOnScrollController = AnimationOnScrollController(
  scrollController: _scrollController,
  vsync: this,
);

{@end-tool}

{@tool snippet} The AnimationOnScrollController should also be disposed by overriding the State.dispose method as stated below:

 _animationOnScrollController.dispose();

{@end-tool}

Implementation

AnimationOnScrollController({
  required this.scrollController,
  this.direction = AnimationDirection.forward,
  this.requiredScrollOffset = 32.0,
  required this.vsync,
  this.animationDuration = const Duration(milliseconds: 130),
}) {
  _initAnimation();
  _attach();
}