paginated_items_builder library

Classes

LoaderShimmer
What if you have multiple PaginatedItemsBuilder widgets in a single view, then every builder has it's own loader, and you want a pull down refresh handler on the main page, and at the same time don't want every widget to render it's own loader, instead, have a common global loader for the entire page.
PaginatedItemsBuilder<T>
Handles rendering the items on the screen. Can have PaginationItemsStateHandler as parent if state is not handled externally.
PaginatedItemsBuilderConfig
The config for PaginatedItemsBuilder.
PaginatedItemsResponse<T>
The response object that carries the list of items and handles pagination internally if paginationKey is specified.
PaginationItemsStateHandler<T>
Do not have a controller for a list of items? Or do not want to create one just because of one time use, use PaginationItemsStateHandler, it handles the state internally and wraps above a PaginatedItemsBuilder.
Shimmer
A widget renders shimmer effect over child widget tree.
ShimmerConfig
ShimmerConfig class to customize the loading shimmer colors, duration etc.

Enums

ItemsDisplayType
enum used to check how the items are to be rendered on the screen. Whether in a list view or a grid view.
ItemsFetchScope
Defines the scope from which PaginatedItemsBuilder.fetchPageData in PaginatedItemsBuilder was called.
ShimmerDirection
An enum defines all supported directions of shimmer effect

Extensions

PaginatedItemsResponseMerge on PaginatedItemsResponse<T>?
Lets a controller merge a fetched page without spelling out the null-or-reset branch every time.

Typedefs

ErrorTextGetter = String Function(dynamic error)
Defines the type ErrorTextGetter.
ErrorWidgetBuilder = Widget Function(dynamic error, VoidCallback refreshOnTap)
Defines the type ErrorWidgetBuilder.
NoItemsTextGetter = String Function(String name)
Defines the type NoItemsTextGetter.
NoItemsWidgetBuilder = Widget Function(String? typeKey, VoidCallback refreshOnTap)
Defines the type NoItemsWidgetBuilder.
RefreshIconBuilder = Widget Function(VoidCallback refreshOnTap)
Defines the type RefreshIconBuilder.
ShowLoaderOnResetGetter = bool Function(ItemsFetchScope itemsFetchScope)
Defines the type ShowLoaderOnResetGetter.