flutter_request_bloc library

Classes

BaseRepository<S extends BaseService, T>
Agent that handles the structure process of raw data, coming from a Service agent.
BaseService<S>
This class serves as a base for building API clients.
RequestBuilder<C extends RequestCubit<BaseRepository<BaseService, dynamic>, dynamic>, T>
This widget makes contruction UI using Request object pretty easily. It has a RequestWidgetBuilder parameter for each RequestState value, so that the interface can adapt to the current status of the request.
RequestCubit<R extends BaseRepository<BaseService, dynamic>, T>
Cubit that simplyfies state and repository management. It uses RequestState as the main state, with the specific type T. The repository R is also used to download the data. Events are emited from the loadData method, to signify the change of state within the network request process.
RequestPersistantCubit<R extends BaseRepository<BaseService, dynamic>, T>
Cubit that extends on RequestCubit by adding the ability to store its internal state using HydratedBloc. Serialization is handled automatically by the state and the cubit state.
RequestState<T>
Class that handles state, value and possible errors generated during a network data transmission.

Enums

RequestStatus
Variable that represents the current state of the response operation.

Typedefs

RequestWidgetBuilderError<T> = Widget Function(BuildContext context, RequestState<T> state, String? errorMessage)
RequestWidgetBuilderInit<T> = Widget Function(BuildContext context, RequestState<T> state)
RequestWidgetBuilderLoaded<T> = Widget Function(BuildContext context, RequestState<T> state, T? value)