Describe the bug
BlocProvider<BlocA>(
create: (BuildContext context) => BlocA(BlocProvider.of<BlocB>(context)),
child: BlocProvider<BlocB>(
create: (BuildContext context) => BlocB(BlocProvider.of<BlocA>(context)),
child: BlocProvider<BlocC>(
create: (BuildContext context) => BlocC(),
child: ChildA(),
)
)
)
How does BlocA and BlocB work with each other required?
The BlocProvider.of<BlocB>(context) not within a child
Hi @zengzhengrong 馃憢
Thanks for opening an issue!
I'm not sure I understand the question but in general you should really avoid having circular dependencies like this. Are you able to provide a link to a sample app which illustrates the issue as well as provide more context? Thanks 馃憤
Hi @felangel
Thanks ,it probably should avoid circular dependencies, I migrate BlocProvider.of<BlocB>(context) to UI Page and add event to blocB after BlocAstate be generated.By my issue BlocB.add() is before yield BlocAState()
Most helpful comment
Hi @felangel
Thanks ,it probably should avoid circular dependencies, I migrate
BlocProvider.of<BlocB>(context)to UI Page and add event to blocB after BlocAstate be generated.By my issue BlocB.add() is beforeyield BlocAState()