New
5.0.0
Added
PagingListenerwidget to connect aPagingControllerto aPagedLayoutBuilder.
Changed
PagingControllerno longer hasaddPageRequestListenermethod andfirstPageKeyparameter. Use thefetchPageparameter of the constructor instead.PagingControllerno longer has theitemList,error, andnextPageKeygetters and setters. All values are now stored inPagingState.PagingControllerno longer has theappendPageandappendLastPagemethods. Use thecopyWithmethod ofPagingStateto update itspages,keys, andhasNextPagefields.PagingControllerno longer has theretryLastFailedRequestmethod. You can simply callfetchNextPageto try again.PagingControllerno longer has theinvisibleItemsThresholdfield. It is now configured inPagedChildBuilderDelegate.PagingControllernow features getters matching the fields ofPagingStateas well asmapItemsto modify the items.PagedLayoutBuilderno longer acceptspagingControlleras a parameter. It now takesPagingStateandfetchNextPageinstead.PagingStatenow usespages(List<List<ItemType>>) instead ofitemList(List<ItemType>). A new extension getteritemsis provided for flattening.PagingStatenow featureskeys, a list storing all fetched keys, andhasNextPagereplacingnextPageKey.PagingStatenow includesisLoading, which tracks whether a request is in progress.PagingStatenow provideserroras typeObject?instead ofdynamic.PagingStatenow includesmapItemsandfilterItemsextension methods for modifying items conveniently.
Fixed
PagingControllernow deduplicates requests.PagingControllerrefresh operations now cancel previous requests.- Off-by-one error in
invisibleItemsThresholdcalculation. - Failure to trigger page request when
invisibleItemsThresholdis too large. - Animating between states with
animateTransitions.