check method

void check()

Runs the near-end check. Called automatically by the attached controller's listener; may also be invoked manually after programmatic scrolls.

Implementation

void check() {
  final controller = _controller;
  if (controller == null || !controller.hasClients) return;
  final position = controller.position;
  if (!position.hasContentDimensions) return;
  if (position.maxScrollExtent <= 0) return;
  if (position.maxScrollExtent - position.pixels <= thresholdExtent) {
    onNearEnd?.call();
  }
}