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< ProvidersValueT> , ValueT> - 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
Familyof auto-dispose BlocProvider. -
Bloc<
Event, State> -
Takes a
StreamofEventsas input and transforms them into aStreamofStatesas 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
Stateto 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< ProvidersValueT> , ValueT> - 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< ProvidersValueT> , ValueT> - 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
listenWhenorbuildWhenin the commonBlocListenerorBlocBuilder
Typedefs
-
BlocUpdateCondition<
S> = bool Function(S previous, S current) -
Signature for the
shouldNotifyfunction which takes the previousstateand the currentstateand is responsible for returning a bool which determines whether or not to callref.listen()orref.watchwith the currentstate. -
EventHandler<
Event, State> = FutureOr< void> Function(Event event, Emitter<State> emit) -
An event handler is responsible for reacting to an incoming
Eventand 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
whenaProviderListenablewill 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.