Skip to content

5.0.0

Latest
Compare
Choose a tag to compare
@github-actions github-actions released this 24 Feb 17:08
· 2 commits to master since this release

Added

  • PagingListener widget to connect a PagingController to a PagedLayoutBuilder.

Changed

  • PagingController no longer has addPageRequestListener method and firstPageKey parameter. Use the fetchPage parameter of the constructor instead.
  • PagingController no longer has the itemList, error, and nextPageKey getters and setters. All values are now stored in PagingState.
  • PagingController no longer has the appendPage and appendLastPage methods. Use the copyWith method of PagingState to update its pages, keys, and hasNextPage fields.
  • PagingController no longer has the retryLastFailedRequest method. You can simply call fetchNextPage to try again.
  • PagingController no longer has the invisibleItemsThreshold field. It is now configured in PagedChildBuilderDelegate.
  • PagingController now features getters matching the fields of PagingState as well as mapItems to modify the items.
  • PagedLayoutBuilder no longer accepts pagingController as a parameter. It now takes PagingState and fetchNextPage instead.
  • PagingState now uses pages (List<List<ItemType>>) instead of itemList (List<ItemType>). A new extension getter items is provided for flattening.
  • PagingState now features keys, a list storing all fetched keys, and hasNextPage replacing nextPageKey.
  • PagingState now includes isLoading, which tracks whether a request is in progress.
  • PagingState now provides error as type Object? instead of dynamic.
  • PagingState now includes mapItems and filterItems extension methods for modifying items conveniently.

Fixed

  • PagingController now deduplicates requests.
  • PagingController refresh operations now cancel previous requests.
  • Off-by-one error in invisibleItemsThreshold calculation.
  • Failure to trigger page request when invisibleItemsThreshold is too large.
  • Animating between states with animateTransitions.