callTask method

  1. @override
void callTask({
  1. required double overOffset,
  2. Duration? duration,
  3. Curve curve = Curves.linear,
})
override

Implementation

@override
void callTask({
  required double overOffset,
  Duration? duration,
  Curve curve = Curves.linear,
}) {
  if (modeLocked || noMoreLocked || secondaryLocked || !_canProcess) {
    return;
  }
  final to = _position.maxScrollExtent + actualTriggerOffset + overOffset;
  _releaseOffset = actualTriggerOffset + overOffset;
  (_position as ScrollPosition).jumpTo(_position.maxScrollExtent);
  if (clamping) {
    if (duration == null) {
      _offset = actualTriggerOffset + overOffset;
      _mode = IndicatorMode.ready;
      _updateBySimulation(_position, 0);
    } else {
      userOffsetNotifier.value = true;
      _clampingAnimationController!
          .animateTo(to, duration: duration, curve: curve)
          .then((value) {
        userOffsetNotifier.value = false;
        _updateBySimulation(_position, 0);
      });
    }
  } else {
    if (_position is ScrollPosition) {
      if (duration == null) {
        (_position as ScrollPosition).jumpTo(to);
      } else {
        userOffsetNotifier.value = true;
        (_position as ScrollPosition)
            .animateTo(to, duration: duration, curve: curve)
            .then((value) => userOffsetNotifier.value = false);
      }
    }
  }
}