flutter_request_bloc library

Classes

BaseService<S>
This class serves as a base for building API clients.
RequestBuilder<R extends RequestRepository<BaseService, 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.
RequestPersistantRepository<S extends BaseService, T>
Repository that extends on RequestRepository by adding the ability to store its internal state using HydratedBloc. Serialization is handled automatically by the state and the cubit state.
RequestRepository<S extends BaseService, T>
Cubit that simplyfies state and data management. It uses RequestState as the main state, with the specific type T. Events are emited from the loadData method, to signify the change of state within the network request process.
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)
ValueConstructor<T> = T Function(Map<String, dynamic>)
Function that deserialize the data in JSON form to an actual instance of the object.
ValueDeconstructor<T> = Map<String, dynamic>? Function(T?)
Function that serialize the data to a JSON form.