checkNeedLocking method
void
checkNeedLocking()
Implementation
void checkNeedLocking() {
if (isAlive == false ||
clientController.hasClients == false ||
lastDelta.toInt() == 0) {
return;
}
final double delta;
if (lastDelta.isNegative) {
delta = -1;
} else {
delta = 1;
}
if (clientController.position.maxScrollExtent.toInt() == 0) {
lastDelta = 0;
return;
}
final int checkedOffsetAtEdge = checkOffsetAtEdge(delta, clientController);
if (checkedOffsetAtEdge != 0) {
if ((currentScrollPhysics is BlockedScrollPhysics) == false &&
isOverScrolling == false) {
scrollEnableTimer.cancel();
currentScrollPhysics = kDisableScrollPhysics;
notifyListeners();
scrollEnableTimer = Timer(edgeLockingDelay, unlockScroll);
if (parentSilkyScrollState != null && isNeedScrollEventBubbling) {
parentSilkyScrollState!.manualHandleScroll(
lastDelta * 2.8,
isVertical,
);
}
lastDelta = 0;
return;
}
}
// else {
// reserveCallbackScrollOnEdge = null;
// currentScrollPhysics = widgetScrollPhysics;
// }
lastDelta = 0;
}