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
AsyncCubitinstances can register into. - AsyncCubitsLogger
-
Class for logging info and error messages from
async_cubitspackage -
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
failurestate. -
MutationIdle<
T> -
The cubit is in the
idlestate. -
MutationLoading<
T> -
The cubit is in the
loadingstate. -
MutationState<
T> - The state of the MutationCubit.
-
MutationSuccess<
T> -
The cubit is in the
successstate. -
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_cubitspackage - AsyncCubitLoggerInfo = void Function(String key, String message)
-
Function type for logging info messages from
async_cubitspackage -
InvalidateFilter<
T> = bool Function(T cubit)