David Gonzalez
Mar 26, 2023

--

Hi, i think your bloc good practice example is incorrect : you should avoid instantiating MyBloc everytime you build ypur Stateless widget. Therefore you should instantiate it in create function parameter of BlocProvider, to let bloc library manage the lifecycle of your bloc 😉.

--

--

David Gonzalez
David Gonzalez

Written by David Gonzalez

Hi, I’m David, a french mobile applications developer. As a freelance, I work on Android and iOS applications since 2010. I also work on Flutter now !

Responses (2)