bool shouldAutoLoadNextPage({
  required bool hasMoreData,
  required bool isLoadingMore,
  required bool hasClients,
  required double maxScrollExtent,
}) {
  if (!hasMoreData || isLoadingMore) {
    return false;
  }

  // If the list cannot scroll yet, preload the next page to avoid a truncated view.
  return !hasClients || maxScrollExtent <= 0;
}
