mo_infinite_scroll 2.0.0 copy "mo_infinite_scroll: ^2.0.0" to clipboard
mo_infinite_scroll: ^2.0.0 copied to clipboard

Infinite scroll for Flutter with pull-to-refresh, pre-fetch, horizontal lists, error recovery, a Sliver variant, and customisable placeholders.

Changelog #

2.0.0 #

Added #

  • Horizontal lists: scrollDirection on MoInfiniteScroll (pull-to-refresh is automatically disabled on the horizontal axis).
  • reverse, shrinkWrap, pullToRefresh, and scrollController parameters on MoInfiniteScroll.
  • Load-more error recovery: when a page fails after items are already loaded, a compact retry row (DefaultLoadMoreError, overridable via errorMoreIndicator) is shown at the end of the list instead of silently getting stuck.
  • MoInfiniteScrollController.retry() — clears the error state and re-fetches the failed page.
  • MoInfiniteScrollController.itemCount and a read-only lastError getter.
  • Single entry point: import 'package:mo_infinite_scroll/mo_infinite_scroll.dart'; now exports everything.
  • Widget tests covering placeholders, retry flows, pagination, horizontal scrolling, and the sliver variant.

Fixed #

  • The default error placeholder's retry button did nothing (it called fetchNextPage, which is a no-op while an error is pending). It now calls retry().
  • Refresh race condition: calling refresh() while a fetch was in flight could append stale results to the fresh list. Stale responses are now discarded.
  • Pull-to-refresh on short lists: physics now default to AlwaysScrollableScrollPhysics when pull-to-refresh is active, and the empty state is scrollable so it can be pulled too.
  • Swapping the controller, fetcher, or limit on an existing widget is now handled correctly in didUpdateWidget.
  • items no longer copies the whole list on every access (it is a read-only view), removing O(n²) work during builds.
  • Notifications after the controller is disposed no longer throw.

Changed (breaking) #

  • refresh() and fetchNextPage() no longer take (fetcher, limit) — the widget attaches them to the controller automatically. Call controller.attach(fetcher, limit) manually only when using a controller without a widget (e.g. in tests).
  • Implementation files moved to lib/src/; import the package barrel instead of individual files.
  • lastError is now a read-only getter.
  • Removed the unused MoInfiniteScrollState enum.

1.0.2 #

[Added] #

  • Example file
2
likes
160
points
32
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Infinite scroll for Flutter with pull-to-refresh, pre-fetch, horizontal lists, error recovery, a Sliver variant, and customisable placeholders.

Homepage
Repository (GitHub)
View/report issues

Topics

#infinite-scroll #pagination #listview #lazy-loading #pull-to-refresh

License

MIT (license)

Dependencies

flutter

More

Packages that depend on mo_infinite_scroll