riverbloc library

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

Providers:

Classes

AlwaysAliveProviderBase<State>
A base class for providers that never disposes themselves.
AsyncData<T>
Creates an AsyncValue with a data.
AsyncError<T>
Creates an AsyncValue in error state.
AsyncLoading<T>
Creates an AsyncValue in loading state.
AsyncValue<T>
An utility for safely manipulating asynchronous data.
AutoDisposeBlocProvider<B extends BlocBase<S>, S>
Auto Dispose
AutoDisposeBlocProviderBuilder
Builds a AutoDisposeBlocProvider.
AutoDisposeBlocProviderFamily<B extends BlocBase<S>, S, Arg>
A class that allows building a AutoDisposeBlocProvider from an external parameter.
AutoDisposeBlocProviderFamilyBuilder
Builds a AutoDisposeBlocProviderFamily.
AutoDisposeBlocProviderRef<B extends BlocBase<Object?>>
An object used by providers to interact with other providers and the life-cycles of the application.
AutoDisposeFutureProvider<State>
A provider that asynchronously creates a single value.
AutoDisposeFutureProviderFamily<State, Arg>
A class that allows building a AutoDisposeFutureProvider from an external parameter.
AutoDisposeFutureProviderRef<State>
An object used by providers to interact with other providers and the life-cycles of the application.
AutoDisposeProvider<State>
A provider that exposes a read-only value.
AutoDisposeProviderBase<State>
A base class for providers that destroy their state when no-longer listened.
AutoDisposeProviderElement<State>
An AutoDisposeProviderElementBase for AutoDisposeProvider
AutoDisposeProviderElementBase<State>
The ProviderElementBase of an AutoDisposeProviderBase.
AutoDisposeProviderFamily<State, Arg>
A class that allows building a Provider from an external parameter.
AutoDisposeProviderRef<State>
An object used by providers to interact with other providers and the life-cycles of the application.
AutoDisposeRef
A Ref for providers that are automatically destroyed when no-longer used.
AutoDisposeStateNotifierProvider<Notifier extends StateNotifier<State>, State>
Creates a StateNotifier and expose its current state.
AutoDisposeStateNotifierProviderFamily<Notifier extends StateNotifier<State>, State, Arg>
A class that allows building a StateNotifierProvider from an external parameter.
AutoDisposeStateNotifierProviderRef<Notifier extends StateNotifier<State>, State>
An object used by providers to interact with other providers and the life-cycles of the application.
AutoDisposeStateProvider<State>
A provider that expose a value which can be modified from outside.
AutoDisposeStateProviderElement<State>
The ProviderElementBase for StateProvider
AutoDisposeStateProviderFamily<State, Arg>
AutoDisposeStateProviderRef<State>
An object used by providers to interact with other providers and the life-cycles of the application.
AutoDisposeStreamProvider<State>
Creates a stream and expose its latest event.
AutoDisposeStreamProviderFamily<State, Arg>
A class that allows building a StreamProvider from an external parameter.
AutoDisposeStreamProviderRef<State>
An object used by providers to interact with other providers and the life-cycles of the application.
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.
BlocOverrides
This class facilitates overriding BlocObserver and EventTransformer. It should be extended by another class in client code with overrides that construct a custom implementation. The implementation in this class defaults to the base blocObserver and eventTransformer implementation. For example:
BlocProvider<B extends BlocBase<S>, S>
BlocProvider
BlocProviderFamily<B extends BlocBase<S>, S, Arg>
A class that allows building a BlocProvider from an external parameter.
BlocProviderFamilyBuilder
Builds a BlocProviderFamily.
BlocProviderRef<B extends BlocBase<Object?>>
An object used by providers to interact with other providers and the life-cycles of the application.
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.
Emitter<State>
An Emitter is a class which is capable of emitting new states.
ErrorSink
A generic destination for errors.
Family<State, Arg, FamilyProvider extends ProviderBase<State>>
A base class for all families
FamilyOverride<Arg>
Do not use: Internal object to used by ProviderContainer/ProviderScope to override the behavior of a "family" for part of the application.
FutureProvider<State>
A provider that asynchronously creates a single value.
FutureProviderFamily<State, Arg>
A class that allows building a AutoDisposeFutureProvider from an external parameter.
FutureProviderRef<State>
An object used by providers to interact with other providers and the life-cycles of the application.
Override
An object used by ProviderContainer/ProviderScope to override the behavior of a provider/family for part of the application.
Provider<State>
A provider that exposes a read-only value.
ProviderBase<State>
A base class for all providers.
ProviderContainer
An object that stores the state of the providers and allows overriding the behavior of a specific provider.
ProviderElement<State>
A provider that exposes a read-only value.
ProviderElementBase<State>
An internal class that handles the state of a provider.
ProviderFamily<State, Arg>
A class that allows building a Provider from an external parameter.
ProviderListenable<State>
A base class for all providers, used to consume a provider.
ProviderObserver
An object that listens to the changes of a ProviderContainer.
ProviderOverride
An object used by ProviderContainer to override the behavior of a provider for a part of the application.
ProviderRef<State>
An object used by providers to interact with other providers and the life-cycles of the application.
ProviderSubscription<State>
Represents the subscription to a provider
Ref
An object used by providers to interact with other providers and the life-cycles of the application.
StateController<T>
A StateNotifier that allows modifying its state from outside.
StateNotifier<T>
An observable class that stores a single immutable state.
StateNotifierProvider<Notifier extends StateNotifier<State>, State>
Creates a StateNotifier and expose its current state.
StateNotifierProviderFamily<Notifier extends StateNotifier<State>, State, Arg>
A class that allows building a StateNotifierProvider from an external parameter.
StateNotifierProviderRef<Notifier extends StateNotifier<State>, State>
An object used by providers to interact with other providers and the life-cycles of the application.
StateProvider<State>
A provider that expose a value which can be modified from outside.
StateProviderElement<State>
The ProviderElementBase for StateProvider
StateProviderFamily<State, Arg>
StateProviderRef<State>
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.
StreamProvider<State>
Creates a stream and expose its latest event.
StreamProviderFamily<State, Arg>
A class that allows building a StreamProvider from an external parameter.
StreamProviderRef<State>
An object used by providers to interact with other providers and the life-cycles of the application.
Transition<Event, State>
A Transition is the change from one state to another. Consists of the currentState, an event, and the nextState.

Mixins

AlwaysAliveProviderListenable<State>
A base class for all providers, used to consume a provider.
BlocProviderOverrideMixin<B extends BlocBase<S>, S>
Add overrideWithValue to AutoDisposeBlocProvider
StateNotifierProviderOverrideMixin<Notifier extends StateNotifier<State>, State>
Add overrideWithValue to AutoDisposeStateNotifierProvider

Extensions

AlwaysAliveAsyncProviderX on AlwaysAliveProviderBase<AsyncValue<State>>
Adds future and stream to providers that emit an AsyncValue
AsyncValueX on AsyncValue<T>
An extension that adds methods like when to an AsyncValue.
AutoDisposeAsyncProviderX on AutoDisposeProviderBase<AsyncValue<State>>
Adds future and stream to autoDispose providers that emit an AsyncValue
XAutoDisposeFamily on Family<State, Arg, FamilyProvider>
An extension that adds overrideWithProvider to Family.
XFamily on Family<State, Arg, FamilyProvider>
An extension that adds overrideWithProvider to Family.

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.
Create<T, R extends Ref> = T Function(R ref)
A callback used by providers to create the value exposed.
ErrorListener = void Function(Object error, StackTrace? stackTrace)
A callback that can be passed to StateNotifier.onError.
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.
FamilyCreate<T, R extends Ref, Arg> = T Function(R ref, Arg arg)
A Create equivalent used by Family.
Locator = T Function<T>()
A function that allows obtaining other objects.
ProviderReference = Ref
Alias for Ref
Reader = T Function<T>(ProviderBase<T> provider)
A function that reads the state of a provider.
RemoveListener = void Function()
A callback that can be used to remove a listener added with StateNotifier.addListener.
SetupOverride = void Function({required ProviderBase origin, required ProviderBase override})
An implementation detail for the override mechanism of providers

Exceptions / Errors

CircularDependencyError
An error thrown when a call to Ref.read/Ref.watch leads to a provider depending on itself.
DependencyNotFoundException<T>
Thrown when tried to call LocatorMixin.read<T>(), but the T was not found.s
ProviderException
Encapulates an exception thrown while building a provider.
StateNotifierListenerError
An error thrown when tried to update the state of a StateNotifier, but at least of the listeners threw.
UnimplementedProviderError<P extends ProviderOrFamily>
Error that will be throw when the provider is not implemented and must be overridden.