cubit/cubit library

Classes

FireData<T>
MutationBuilder<T, B extends Cubit<ResourceState<T>>>
QueryBuilder<T, B extends Cubit<ResourceState<T>>>
Responsible for handling loading, retrying Useful for non-paged-list data
ResourceCubit<T>
This abstracts calling repository and handling result.
ResourceListCubit<T>
ResourceListData<T>
This is used for showing what data has been added or updated in list
ResourceState<T>

Typedefs

OnExceptionCallback = void Function(String)
OnSuccessCallback<T> = Future<void> Function(T result)
Function which will be invoked after successful mutation/query
QueryExecutor<T> = Future<T> Function()
This can be both query and mutation since they return similar result.
ResourceMutationBuilder<B, D> = Widget Function(BuildContext context, B cubit, D? data)
ResourceMutationOnError = void Function(BuildContext context, String? message)
ResourceMutationOnSuccess<D> = void Function(BuildContext context, D data)
ResourceQueryBuilder<D> = Widget Function(BuildContext context, D data)
Cubit has its own uses here like in BalanceText etc
ResourceQueryOnSuccess<D> = void Function(BuildContext context, D data)
ResourceQueryRetryBuilder<B> = void Function(B cubit)
ResultParser<T> = T Function(T result)
Parser must return expected result.