base_list library

Classes

Empty
State indicating that data was loaded successfully, but was null or empty.
Failure
State indicating that loading or refreshing has failed. It contains an exact error that has occurred.
Initial
The initial view state.
ListBloc<T>
A basic list BLoC with no filtering or pagination. Thus it should be used with a reasonable small amount of data. [...]
ListRepository<T>
ListRepository handles all data operations. It knows where to get the data from and what API calls to make when data is updated. [...]
Loading
State indicating that data is being loaded.
Refreshing<T>
State indicating that data is being refreshed. It can occur only after initial loading ends with Success or Empty result. It may contain the data that has already been loaded.
RefreshView
A widget that wraps a widget with a RefreshIndicator designed to be used with BLoC pattern. [...]
Success<T>
State indicating that data was loaded successfully and is not null nor empty. T - list element type.
ViewState
Base class for states.
ViewStateBuilder<T, B extends Bloc<dynamic, ViewState>>
ViewStateBuilder is responsible for building the UI based on the ViewState. It's a wrapper over the BlocBuilder widget so it accepts a bloc object and a set of handy callbacks, which corresponds to each possible state: onReady callback for the the initial state, onLoading callback for the data loading state, onRefreshing callback for the data refreshing state, onSuccess callback for the data success state, onEmpty callback for for no result state, onError callback function for an error state. T - the type of list elements, B - the type of bloc.

Typedefs

EmptyCallback(BuildContext context) Widget
Callback function for no result. The data was fetched successfully, but a null element was returned.
ErrorCallback(BuildContext context, dynamic error) Widget
Callback function for an error. It contains an error that has caused which may allow a view to react differently on different errors.
InitialCallback(BuildContext context) Widget
Callback function for the the initial state.
LoadingCallback(BuildContext context) Widget
Callback function for the data loading state.
RefreshingCallback<T>(BuildContext context, T data) Widget
Callback function for the data refreshing state. Can only occur after SuccessCallback.
SuccessCallback<T>(BuildContext context, T data) Widget
Callback function for a success. The data was fetched and nonnull element was returned.