refena_flutter library

Classes

AbstractChangeEvent<T>
A flag that is applied for ChangeEvent and RebuildEvent.
ActionDispatchedEvent
An action has been dispatched. Usually, a ChangeEvent directly follows this event. If the action is asynchronous, the ChangeEvent can be delayed.
ActionErrorEvent
An action threw an error.
ActionFinishedEvent
An action has been finished successfully.
AsyncData<T> Async Value
The data of an AsyncValue.
AsyncError<T> Async Value
The error of an AsyncValue.
AsyncGlobalAction Redux
An asynchronous global action without a result.
AsyncGlobalActionWithResult<R> Redux
An asynchronous global action with a result.
AsyncLoading<T> Async Value
The loading state of an AsyncValue.
AsyncNotifier<T>
An AsyncNotifier is a notifier that holds the state of an AsyncSnapshot. It is used for business logic that depends on asynchronous operations.
AsyncNotifierProvider<N extends AsyncNotifier<T>, T>
Use an AsyncNotifierProvider to implement a stateful provider. Changes to the state are propagated to all consumers that called watch on the provider.
AsyncNotifierTester<N extends BaseAsyncNotifier<T>, T>
A wrapper for BaseAsyncNotifier that exposes setState and state. It creates a container internally, so any ref call still works. This is useful for unit tests.
AsyncReduxAction<N extends BaseReduxNotifier<T>, T> Redux
The asynchronous action that is dispatched by a ReduxNotifier. Trigger this with dispatchAsync.
AsyncReduxActionWithResult<N extends BaseReduxNotifier<T>, T, R> Redux
The asynchronous action that is dispatched by a ReduxNotifier.
AsyncValue<T> Async Value
BaseReduxAction<N extends BaseReduxNotifier<T>, T, R>
The action that is dispatched by a ReduxNotifier. You should use ReduxAction or AsyncReduxAction instead.
ChangeEvent<T>
The most frequent event. A notifier changed its state and notifies all listeners that they should rebuild.
ChangeNotifier
A notifier that can trigger notifyListeners to trigger rebuilds. It has access to ref for fast development.
ChangeNotifierProvider<N extends ChangeNotifier>
Use a NotifierProvider to implement a stateful provider. Changes to the state are propagated to all consumers that called watch on the provider.
Consumer
A Consumer can be used anywhere in the widget tree. This is useful if you want to use a provider within a StatelessWidget.
Dispatcher<N extends BaseReduxNotifier<T>, T>
A proxy class to provide a custom debugOrigin for dispatch.
ExpensiveConsumer
Similar to Consumer but with a child that is not rebuilt when the provider changes. This is useful if the child is expensive to build.
FamilyViewModelBuilder<T, P, R>
Similar to ViewModelBuilder, but designed for family providers.
FutureFamilyProvider<T, P>
A FutureFamilyProvider is a special version of FutureProvider that allows you to watch a collection of Futures.
FutureFamilyProviderNotifier<T, P>
The corresponding notifier of a FutureFamilyProvider.
FutureProvider<T>
A FutureProvider is a custom implementation of a AsyncNotifierProvider that allows you to watch a Future.
FutureProviderNotifier<T>
The corresponding notifier of a FutureProvider.
GlobalAction Redux
A synchronous global action without a result.
GlobalActionDispatcher
GlobalActionWithResult<R> Redux
A synchronous global action with a result.
GlobalRedux
The corresponding global redux notifier.
GraphInputBuilder
A configuration for the graph page.
HistoryObserverConfig
The configuration of the RefenaHistoryObserver. It defines which events are saved.
IdReference
An arbitrary object that has an id. We cannot rely on identical() because this information cannot be serialized.
ImmutableNotifier<T>
A notifier that is immutable. The state of the notifier is provided in the constructor.
LabeledIdReference
An arbitrary object that is a IdReference and a LabeledReference.
LabeledReference
An arbitrary object that has a debugLabel property.
MessageEvent
A custom message. This is useful for debugging.
Notifier<T>
A notifier holds a state and notifies its listeners when the state changes. The listeners are added automatically when calling ref.watch.
NotifierEvent<T>
The object that gets fired by the stream.
NotifierProvider<N extends BaseSyncNotifier<T>, T>
Use a NotifierProvider to implement a stateful provider. Changes to the state are propagated to all consumers that called watch on the provider.
NotifierSnapshot<T>
A snapshot of the AsyncNotifier.
NotifierTester<N extends BaseSyncNotifier<T>, T>
A wrapper for BaseSyncNotifier that exposes setState and state. It creates a container internally, so any ref call still works. This is useful for unit tests.
Provider<T>
Use a Provider to implement a stateless provider. Useful for dependency injection. Often used with overrideWithValue during initialization of the app.
ProviderDisposeEvent
A provider has been disposed. This does not happen automatically but only when ref.dispose(provider) is called.
ProviderInitEvent
A provider is initialized (happens only once per runtime). This happens either immediately during provider override or lazily when the provider is accessed the first time.
ProviderOverride<N extends BaseNotifier<T>, T>
Instructs Refena to set a predefined state for a provider.
PureNotifier<T>
A Notifier but without ref making this notifier self-contained.
RebuildEvent<T>
A ViewProvider has been rebuilt. (NOT widget rebuild) This is very similar to a ChangeEvent but instead of one action, there can be multiple pairs of actions and notifiers.
ReduxAction<N extends BaseReduxNotifier<T>, T> Redux
The action that is dispatched by a ReduxNotifier. Trigger this with dispatch.
ReduxActionWithResult<N extends BaseReduxNotifier<T>, T, R> Redux
The action that is dispatched by a ReduxNotifier.
ReduxNotifier<T> Redux
A notifier where the state can be updated by dispatching actions by calling dispatch.
ReduxNotifierTester<T>
A wrapper for BaseReduxNotifier that exposes setState and state. This is useful for unit tests.
ReduxProvider<N extends BaseReduxNotifier<T>, T> Redux
Holds a ReduxNotifier
Ref Introduction
The base ref to read and notify providers. These methods can be called anywhere. Even within dispose methods. The primary difficulty is to get the Ref in the first place.
RefenaCallbackObserver
An observer where you can specify the behavior right in the constructor. This is useful for testing to avoid boilerplate code.
RefenaContainer Initialization Introduction Riverpod
The RefenaContainer holds the state of all providers. Every provider state is initialized lazily and only once.
RefenaDebugObserver
A plug-and-play RefenaObserver that prints every action into the console for easier debugging.
RefenaEvent
The base event.
RefenaGraphPage
RefenaHistoryObserver Testing
An observer that stores every event in a list. This is useful for testing to keep track of the events.
RefenaMultiObserver
The observer to use multiple observers at once.
RefenaObserver
The observer receives every RefenaEvent. It is up to the implementation of how to use it.
RefenaScope
A wrapper widget around RefenaContainer.
RefenaTracingObserver
A more sophisticated version of RefenaHistoryObserver. This should be used in combination with RefenaTracingPage.
RefenaTracingPage
RefreshAction<N extends BaseReduxNotifier<AsyncValue<T>>, T>
An action that refreshes the state of a ReduxNotifier. The state must be an AsyncValue with the data type T.
RefreshSetErrorAction<N extends BaseReduxNotifier<AsyncValue<T>>, T>
Sets the state of a ReduxNotifier to AsyncValue.withError.
RefreshSetLoadingAction<N extends BaseReduxNotifier<AsyncValue<T>>, T>
Sets the state of a ReduxNotifier to AsyncValue.loading.
StateNotifier<T>
A pre-implemented notifier for simple use cases. You may add a listener to retrieve every setState event.
StateProvider<T>
A StateProvider is a custom implementation of a NotifierProvider that implements a default notifier with a setState method.
StreamProvider<T>
A provider that listens to a Stream and exposes its latest value.
StreamProviderNotifier<T>
The corresponding notifier of a StreamProvider.
TracingInputBuilder
A configuration for the tracing page.
TracingNotifier
ViewFamilyProvider<T, P>
Similar to ViewProvider but with a parameter. It is essentially a syntax sugar for ViewProvider<Map<P, T>>.
ViewFamilyProviderNotifier<T, P>
The corresponding notifier of a ViewFamilyProvider.
ViewModelBuilder<T, R>
A widget that uses exactly one provider to build the widget tree. On widget dispose, the provider will be disposed as well.
ViewProvider<T>
The ViewProvider is the only provider that can watch other providers. Its builder is similar to a normal Provider. A common use case is to define a view model that depends on many providers. Don't worry about the ref, you can use it freely inside any function. The ref will never become invalid.
ViewProviderNotifier<T>
WatchableRef
The ref available in a State with the mixin or in a ViewProvider.
WatchAction<N extends BaseReduxNotifier<T>, T> Redux
TLDR: This action reruns the reduce method whenever a watched provider changes.
WatchActionSubscription
A handle to cancel a WatchAction. Usually this is not needed as the WatchAction is automatically cancelled when the ReduxNotifier is disposed.
WatchUpdateAction<N extends BaseReduxNotifier<T>, T>
A simple action that updates the state.
WidgetRebuildable<W extends Widget>
A helper class for unit tests. Use this in combination with RefenaHistoryObserver.

Enums

ActionLifecycle
The location of an error.
NotifyStrategy
This enum controls the default behaviour of updateShouldNotify. Keep in mind that you can override updateShouldNotify in your notifiers to implement a custom behaviour.
PlatformHint
This type is used to represent the platform type without depending on Flutter or dart:io.
ProviderInitCause

Mixins

GlobalActions<N extends BaseReduxNotifier<T>, T, R>
Refena<W extends StatefulWidget>

Properties

globalReduxProvider ReduxProvider<GlobalRedux, void> Redux
The global redux provider.
final
tracingProvider ChangeNotifierProvider<TracingNotifier>
final

Typedefs

ErrorParser = Map<String, dynamic>? Function(Object error)
Parses an error to a map. This is used by the tracing page to display the error in a human-readable format. This is also used by the RefenaInspectorObserver to to send the error to the inspector.
FutureBuilder<T, P> = Future<T> Function(Ref ref, P param)
MockGlobalReducer = void Function(Ref ref)
Function type for a mocked global reducer.
MockReducer<T> = Object? Function(T state)
Function type for a mocked reducer.
ViewFamilyBuilder<T, P> = T Function(WatchableRef ref, P param)