defaultSlideEndHandler function

bool defaultSlideEndHandler(
  1. {Offset offset,
  2. Size pageSize,
  3. SlideAxis pageGestureAxis}
)

Implementation

bool defaultSlideEndHandler(
    {Offset offset, Size pageSize, SlideAxis pageGestureAxis}) {
  const int parameter = 6;
  if (pageGestureAxis == SlideAxis.both) {
    return doubleCompare(offset.distance,
            Offset(pageSize.width, pageSize.height).distance / parameter) >
        0;
  } else if (pageGestureAxis == SlideAxis.horizontal) {
    return doubleCompare(offset.dx.abs(), pageSize.width / parameter) > 0;
  } else if (pageGestureAxis == SlideAxis.vertical) {
    return doubleCompare(offset.dy.abs(), pageSize.height / parameter) > 0;
  }
  return true;
}