async_cubits library

A set of Cubits that helps to handle async operations in simple and consistent way.

Classes

AsyncCubit<T>
AsyncCubit is a cubit that loads data from some async source (eg. network, database).
AsyncCubitContainer
A registry that AsyncCubit instances can register into.
AsyncCubitsLogger
Class for logging info and error messages from async_cubits package
AsyncData<T>
A state representing that asynchronous computation has succeeded with a value
AsyncError<T>
A state representing that asynchronous computation has failed with an error
AsyncLoading<T>
A state representing that the value is being fetched asynchronously (e.g. from a network call).
AsyncValue<T>
AsyncValue represents a state of an asynchronous computation.
FutureCubit<T>
FutureCubit loads data from an async source and emits it as AsyncValue.
MutationCubit<I, O>
A cubit that handles a asynchronous mutation. The mutation is provided in the mutation method. But the mutation is invoked by the invoke method.
MutationFailure<T>
The cubit is in the failure state.
MutationIdle<T>
The cubit is in the idle state.
MutationLoading<T>
The cubit is in the loading state.
MutationState<T>
The state of the MutationCubit.
MutationSuccess<T>
The cubit is in the success state.
StreamCubit<T>
StreamCubit loads data from dataStream and emits it in safe way. The result of dataStream is wrapped in AsyncValue.

Extensions

AsyncValueExtension on AsyncValue<T>
Extension on AsyncValue providing utility methods
FutureAsyncValueExtension on Future<AsyncValue<T>>
Extension on Future<AsyncValue> providing utility methods

Typedefs

AsyncCubitLoggerError = void Function(String key, String message, Object error, StackTrace? stackTrace)
Function type for logging error messages from async_cubits package
AsyncCubitLoggerInfo = void Function(String key, String message)
Function type for logging info messages from async_cubits package
InvalidateFilter<T> = bool Function(T cubit)