callTask method
Future
callTask({
- required double overOffset,
- Duration? duration,
- Curve curve = Curves.linear,
- ScrollController? scrollController,
- bool force = false,
Automatically trigger task.
overOffset
Offset beyond the trigger offset, must be greater than 0.
duration
See ScrollPosition.animateTo.
curve
See ScrollPosition.animateTo.
scrollController
When position is not ScrollPosition, you can use ScrollController.
force
Enforce execution even if the task is in progress. But you have to handle the completion event.
Implementation
Future callTask({
required double overOffset,
Duration? duration,
Curve curve = Curves.linear,
ScrollController? scrollController,
bool force = false,
}) {
if (!_mounted) {
return Future.value();
}
if (!force) {
if (modeLocked || noMoreLocked || secondaryLocked || !_canProcess) {
return Future.value();
}
} else {
_offset = 0;
_mode = IndicatorMode.inactive;
_processing = false;
}
return animateToOffset(
offset: actualTriggerOffset + overOffset,
mode: IndicatorMode.ready,
duration: duration,
curve: curve,
scrollController: scrollController,
);
}