scrollDirection function
Implementation
GestureDirection? scrollDirection(num deltaX, num deltaY) {
num deltaXAbs = deltaX.abs();
num deltaYAbs = deltaY.abs();
if (deltaY >= deltaXAbs) {
return GestureDirection.up;
} else if (deltaY <= -deltaXAbs) {
return GestureDirection.down;
} else if (deltaX > deltaYAbs) {
return GestureDirection.right;
} else if (deltaX < -deltaYAbs) {
return GestureDirection.left;
}
return null;
}