no_bloc_flutter library

Classes

AutoPersistedBloc<S>
If bloc is not a singleton then tags must be provided to differentiate between different instances, otherwise different instances will overwrite each other
Bloc<S>
The central class behind this library
BlocBuilder<S>
BlocContainer
Builds, saves and provides Bloc independent of the build tree
BlocEventsPrinter
BlocListBuilder<R, S>
BlocMonitor<T>
Callbacks which are sent by the blocs, can be used for debugging or side effects
HivePersistenceService
ListBloc<R, S>
PersistedBloc<S>
PersistenceService
TypeAndArg
Acts as a key for bloc container cache

Extensions

BlocExtensions on Bloc<S>

Functions

isValueType(dynamic value) bool
Just a utility function to make sure if the state type implements equality (by default dart classes only support referential equality).
testBloc<R extends Bloc<S>, S>(dynamic description, {FutureVoidCallback? setup, required BlocTestBloc<R> bloc, BlocCallback<R>? expectBefore, BlocCallback<R>? expectAfter, required StreamMatcher expectedStates, required BlocCallback<R> job, BlocTestTransform<S, dynamic>? transform, Duration timeout = const Duration(minutes: 1)}) → void
Utility function which abstracts over a dart test to ease off bloc testing

Typedefs

BlocCallback<R> = Future<void> Function(R)
BlocTestBloc<R> = Future<R> Function()
BlocTestTransform<S, T> = T Function(S)
BlocTestVoidCallback = void Function()
BlocWithArgBuilder<T> = T Function(BuildContext? context, dynamic arg)
Takes context and arg, returns a Bloc
DataBuilder<T> = Widget Function(BuildContext context, T data)
This function takes a context and data of type T and returns a widget
Deserializer<T> = T Function(dynamic json)
ErrorBuilder = Widget Function(BuildContext context, StateError error)
This function takes a context and a StateError error and returns a widget
FutureVoidCallback = Future<void> Function()
PersistenceServiceBuilder = PersistenceService Function(String name)
ToWidget<T> = Widget Function(BuildContext, T)