IsolateBlocProvider<T extends IsolateBlocBase<Object?, State>, State>.value constructor

IsolateBlocProvider<T extends IsolateBlocBase<Object?, State>, State>.value({
  1. Key? key,
  2. required IsolateBlocWrapper<Object?> value,
  3. Widget? child,
})

Takes a bloc and a child which will have access to the bloc via IsolateBlocProvider.of(context). When IsolateBlocProvider.value is used, the bloc will not be automatically closed. As a result, IsolateBlocProvider.value should mainly be used for providing existing blocs to new routes.

A new bloc should not be created in IsolateBlocProvider.value. blocs should always be created using the default constructor within create.

IsolateBlocProvider.value(
  value: IsolateBlocProvider.of<BlocA, BlocAState>(context),
  child: ScreenA(),
);

Implementation

IsolateBlocProvider.value({
  Key? key,
  required IsolateBlocWrapper<Object?> value,
  this.child,
})  : _value = value,
      lazy = null,
      super(key: key, child: child);