riverbloc library

Riverbloc exposes providers for Bloc and Cubit instances bases in riverpod package instead of provider package.

Providers:

Classes

AnyNotifier<StateT, ValueT> Notifiers
A base class for all "notifiers".
AsyncData<ValueT> Core
Creates an AsyncValue with a data.
AsyncError<ValueT> Core
Creates an AsyncValue in the error state.
AsyncLoading<ValueT> Core
Creates an AsyncValue in loading state.
AsyncNotifier<StateT> Notifiers
A Notifier implementation that is asynchronously initialized.
AsyncNotifierProvider<NotifierT extends AsyncNotifier<ValueT>, ValueT> Providers
A provider which creates and listen to an AsyncNotifier.
AsyncResult<ValueT>
A variant of AsyncValue that excludes AsyncLoading.
AsyncValue<ValueT> Core
A utility for safely manipulating asynchronous data.
AutoDisposeBlocProviderBuilder
Builds a auto-dispose BlocProvider.
AutoDisposeBlocProviderFamilyBuilder
The Family of auto-dispose BlocProvider.
Bloc<Event, State>
Takes a Stream of Events as input and transforms them into a Stream of States as output.
BlocBase<State>
An interface for the core functionality implemented by both Bloc and Cubit.
BlocEventSink<Event extends Object?>
An ErrorSink that supports adding events.
BlocObserver
An interface for observing the behavior of Bloc instances.
BlocProvider<B extends StateStreamableSource<S>, S>
BlocProvider
BlocProviderFamily<B extends StateStreamableSource<S>, S, ArgT>
A class that allows building a BlocProvider from an external parameter.
BlocProviderFamilyBuilder
Builds a BlocProviderFamily.
Change<State>
A Change represents the change from one State to another. A Change consists of the currentState and nextState.
Closable
An object that must be closed when no longer in use.
Cubit<State>
A Cubit is similar to Bloc but has no notion of events and relies on methods to emit new states.
Emittable<State extends Object?>
An object that can emit new states.
EmittableStateStreamableSource<State>
A StateStreamableSource that can emit new states.
Emitter<State>
An Emitter is a class which is capable of emitting new states.
ErrorSink
A generic destination for errors.
FutureProvider<ValueT> Providers
A provider that asynchronously creates a value.
MultiBlocObserver
A BlocObserver which supports registering multiple BlocObserver instances. This is useful when maintaining multiple BlocObserver instances for different functions e.g. LoggingBlocObserver, ErrorReportingBlocObserver.
Notifier<ValueT> Notifiers
A class which exposes a state that can change over time.
NotifierProvider<NotifierT extends Notifier<ValueT>, ValueT> Providers
A provider that exposes a synchronous Notifier.
Provider<ValueT> Providers
A provider that exposes a read-only value.
ProviderContainer Core
An object that stores the state of the providers and allows overriding the behavior of a specific provider.
ProviderObserver Core
An object that listens to the changes of a ProviderContainer.
ProviderObserverContext Core
Information about the ProviderObserver event.
ProviderReference
The response of ProviderContainer.allProviders.
ProviderSubscription<OutT> Core
Represents the subscription to a ProviderListenable.
Ref Core
An object used by providers to interact with other providers and the life-cycles of the application.
StateStreamable<State>
A Streamable that provides synchronous access to the current state.
StateStreamableSource<State>
A StateStreamable that must be closed when no longer in use.
Streamable<State extends Object?>
An object that provides access to a stream of states over time.
StreamNotifier<ValueT> Notifiers
A variant of AsyncNotifier which has build creating a Stream.
StreamNotifierProvider<NotifierT extends StreamNotifier<ValueT>, ValueT> Providers
A provider which creates and listen to an StreamNotifier.
StreamProvider<ValueT> Providers
Creates a stream and exposes its latest event.
Transition<Event, State>
A Transition is the change from one state to another. Consists of the currentState, an event, and the nextState.

Extensions

AsyncValueExtensions on AsyncValue<ValueT>
Adds non-state related methods/getters to AsyncValue.
ProviderListenableListenable on ProviderListenable<T>
Adds listenable to ProviderListenable.
ProviderListenableSelect on ProviderListenable<InT>
Adds select to ProviderListenable.
ProviderListenableWhenable on ProviderListenable<S>
Provides a when method like listenWhen or buildWhen in the common BlocListener or BlocBuilder

Typedefs

BlocUpdateCondition<S> = bool Function(S previous, S current)
Signature for the shouldNotify function which takes the previous state and the current state and is responsible for returning a bool which determines whether or not to call ref.listen() or ref.watch with the current state.
EventHandler<Event, State> = FutureOr<void> Function(Event event, Emitter<State> emit)
An event handler is responsible for reacting to an incoming Event and can emit zero or more states via the Emitter.
EventMapper<Event> = Stream<Event> Function(Event event)
Signature for a function which converts an incoming event into an outbound stream of events. Used when defining custom EventTransformers.
EventTransformer<Event> = Stream<Event> Function(Stream<Event> events, EventMapper<Event> mapper)
Used to change how events are processed. By default events are processed concurrently.
ListenWhen<S> = bool Function(S previous, S current)
Signature to decide when a ProviderListenable will rebuild.

Exceptions / Errors

AsyncValueIsLoadingException
AsyncValue.requireValue was called on an AsyncValue with no error nor a value.
UnimplementedProviderError<P extends ProviderOrFamily>
Error that will be throw when the provider is not implemented and must be overridden.