onVisibilityChanged method

  1. @visibleForTesting
void onVisibilityChanged(
  1. VisibilityInfo c,
  2. BlocxInfiniteListState state
)

Implementation

@visibleForTesting
void onVisibilityChanged(VisibilityInfo c, BlocxInfiniteListState state) {
  final currentState = bloc.state;
  if (c.visibleFraction < 0.5 ||
      currentState.isLoadingMore ||
      currentState.hasReachedEnd ||
      widget.loadBottomData == null ||
      currentState.isScrollingUp) {
    return;
  }
  bloc.setLoadingBottomStatus(true);
  widget.loadBottomData!.call();
}