0

I need manage the states globally, I find a lot of way, in terms of managing the state by using Provider bloc pattern redux and etc.

But actually I dont know, which one is faster and performant?

Example: I am working on chat application, which I have to manage socket connection messages online offline status all as globally. the states need to be accessible from all screen, like ChatList screen, ChatBox screen and more...

Muhammad
  • 2,572
  • 4
  • 24
  • 46

1 Answers1

2

I didn't test them all performance wise. And i do not think it will make much of a difference.

Provider works with inheritedwidget as scoped model i think. I love the streams for the versatility of the data flow.... i think the key part for performance is to keep the rebuilding/painting of the widgets that require it at the lowest level of the tree.

get_it package should help you to keep those streams accessible everywhere, is a great simple package to keep neat model access, regarding the state management solution.

For instance, i believe that generating statelessstateful widgets instead of functions that returns widgets to make the layout, provides more performance, for the separation of buildcontexts. In any case, the framework is super optimized and performant... if u run into any issue, u can easily track it down with the devtools and the community is very supportive.

Btw, take my basic reply with a grain of salt, as I've been only playing with flutter/dart for a week.

roipeker
  • 1,183
  • 9
  • 9
  • What about stream size, how much data can be store to the stream, and is that possible to use bloc without any third party package??? because I am not in a good mode with using third party package in my app, but I forced to use it. – Muhammad May 14 '20 at 21:47