Member-only story

Flutter State Management Myths

Fred Grott
4 min readDec 30, 2022

--

There is a lot of imprecise and wrong information floating around about flutter state management. This is an attempt to dispel the myths about flutter state management.

Myth One, The Widget Tree

You will see in several cases where someone will state that this is a widget tree, such as claiming this shown by DevTools is a widget tree:

That is not a widget tree! What you are seeing is since you can see actual physical screen layout values is in fact the Render tree! We have three data structures in Flutter:

1. Widget configurations, yes, your widget declarations in your class and function files.

2. Element Tree, this is the one that keeps track of state; and it’s the tree you never see.

3. Render Tree, this is the tree that shows the actual screen sizes, layout boundaries etc.

Myth Two, f(state) equals layout

You constantly see this visual:

--

--

Fred Grott
Fred Grott

No responses yet