Closed saswattech9 closed 3 months ago
anyone can help me out ?
I think u can use depend bloc as a param in constructor. i.e: bloc A depend on bloc B: A(B b) or u can create a global bloc
Global would not be a good option. So what you telling could you give us some example ?
Ex: I have a A bloc depends on B, C bloc
ABloc extends BaseBloc<> {
late final B bBloc;
late final C cBloc;
}
u can overide in ur page
class _PageState extends BasePageState<Page, ABloc> {
@override
late final ABloc bloc = super.bloc
..bBloc = B()
..cBloc = C();
or init b,c instance in initState()
bloc
..bBloc = B()
..cBloc = C();
With this architecture how to communicate between blocs .
Please someone explain with small example.