Hi, I saw that you added a useful thing, since BlocListener fixes many problems in the form of onWidgetDidBuild or globalKey storage on Scaffold, etc.
I looked at the implementation, and I realized that at first all BlocListeners in the widget tree were jerking, only then the tree was rebuild, apparently this is a life hack, but why are you doing skip (1) in a subscription to the widget's state? I removed the skip and nothing has changed, maybe tell me, since this is a very beautiful solution!
Hey @1AlexFix1 馃憢
Thanks for opening an issue!
Regarding your question, the skip(1) is to avoid a trigger on initialState. Removing it won鈥檛 change any functionality but results in an extra invocation of the function.
Not sure what you meant by the BlocListeners in the widget tree were jerking. Can you please explain what you meant? You can check out the SnackBar Recipe for an example of how to use it.
Hope that helps and let me know if you have any other questions! 馃憤
Thanks for the positive feedback! I really appreciate it 馃檹
Hey @1AlexFix1 馃憢
Thanks for opening an issue!Regarding your question, the skip(1) is to avoid a trigger on initialState. Removing it won鈥檛 change any functionality but results in an extra invocation of the function.
Not sure what you meant by the BlocListeners in the widget tree were jerking. Can you please explain what you meant? You can check out the BlocListener Recipe for an example of how to use it.
Hope that helps and let me know if you have any other questions! 馃憤
Thanks for the positive feedback! I really appreciate it 馃檹
Sorry to speak English badly, under the tree of widgets I meant the following. I created the following hierarchy. Forests -> .... -> BlocListener -> ....-> BlocBuilder -> ... -> BlocListener. After the printout of calls, regardless of where BlocListener is located, it is guaranteed to be called first, then only the rebuilding of widgets inside BlocBuilder. Thank you, this is a great solution in my opinion for navigation, etc.
Most helpful comment
Sorry to speak English badly, under the tree of widgets I meant the following. I created the following hierarchy. Forests -> .... -> BlocListener -> ....-> BlocBuilder -> ... -> BlocListener. After the printout of calls, regardless of where BlocListener is located, it is guaranteed to be called first, then only the rebuilding of widgets inside BlocBuilder. Thank you, this is a great solution in my opinion for navigation, etc.