IsolateBlocProvider<T extends IsolateBlocBase<Object?, State> , State> constructor
IsolateBlocProvider<T extends IsolateBlocBase<Object?, State> , State> ({})
Takes a ValueBuilder
that is responsible for creating the bloc
and
a child which will have access to the bloc
via
IsolateBlocProvider.of(context)
.
It is used as a dependency injection (DI) widget so that a single instance
of a bloc
can be provided to multiple widgets within a subtree.
Automatically handles closing the bloc
when used with create
.
IsolateBlocProvider(
create: (BuildContext context) => BlocA(),
child: ChildA(),
);
Implementation
IsolateBlocProvider({
Key? key,
this.child,
this.lazy,
}) : _value = null,
super(key: key, child: child);