FlameBlocProvider<B extends BlocBase<S> , S> constructor
FlameBlocProvider<B extends BlocBase<S> , S> ({
- required B create(),
- List<
Component> ? children, - ComponentKey? key,
A Component
that provides a Bloc
to its children
Will provide the Bloc
returned by the create
function,
when this constructor is used, the bloc will only live while
this component is alive.
Implementation
FlameBlocProvider({
required B Function() create,
List<Component>? children,
super.key,
}) : _bloc = create(),
_created = true {
_addChildren(children);
}