react_bloc
library
Constants
-
blocScopeContext
→ const ReactContext<Bloc?>
-
React context carrying the nearest bloc instance.
Functions
-
blocProvider<T extends Bloc>(T bloc, List<ReactNode> children)
→ ReactNode
-
Wraps
children so they can resolve bloc through useBloc.
-
useBloc<T extends Bloc>()
→ T
-
Returns the nearest bloc from blocProvider.
-
useBlocSelector<B extends Bloc<dynamic, S>, S, T>(B bloc, T selector(S state))
→ T
-
Selects part of
bloc's state and rebuilds when that snapshot changes.
-
useBlocState<B extends Bloc<dynamic, S>, S>(B bloc)
→ S
-
Rebuilds this component whenever
bloc's state changes.