Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 1.51 KB

README.md

File metadata and controls

31 lines (22 loc) · 1.51 KB

Build style: effective dart License: MIT

Streamed items state management package

State management of items that are received via a stream with updates. Added, Modified and Removed are the possible updates to the items.

It can also be used for streamed pages of data where all of them will have realtime updates. There is PagedStreamsItemsStateNotifier for this purpose.

All of this is possible with the combination of predefined slivers for scroll list view and grid view that can display the ItemsState. These slivers also request more data in case of paginated ItemsState.

Example

There is an example that shows the possible usage with an example ProductModel. It uses the Riverpod for the state management. This example is using just a single stream for receiving products (the stream is using mocked data and sending price updates to products with some delays).

In case we need to paginate the data, then the change is really similar to the current single stream (single page) example. The ProductsStateNotifier would just need to inherit from the PagedStreamsItemsStateNotifier instead of the SingleStreamItemsStateNotifier.

TODO

  • better logging