isStatic method

bool isStatic(
  1. double delta,
  2. AnimationType type,
  3. AnimationScrollDirection direction, [
  4. bool snap = true,
  5. bool? isScrolling,
])

Implementation

bool isStatic(
    double delta, AnimationType type, AnimationScrollDirection direction,
    [bool snap = true, bool? isScrolling]) {
  final shouldSnap = snap && isScrolling == false;

  final isForward = direction == AnimationScrollDirection.forward;
  final exiting = delta < 0;
  final onlyIn = isForward ? !exiting : exiting;
  final onlyOut = isForward ? exiting : !exiting;
  final onlyStart = !exiting;
  final onlyEnd = exiting;
  final animate = type == AnimationType.animateIn
      ? onlyIn
      : type == AnimationType.animateOut
          ? onlyOut
          : type == AnimationType.start
              ? onlyStart
              : type == AnimationType.end
                  ? onlyEnd
                  : true;
  return shouldSnap || !animate;
}