You may laugh, but that probably happens more than we’d like to admit.
And with Flutter, that’s not entirely inconceivable in that with Flutter and Flutter’s way of handling composing UIs. You have to handle data flowing through your app, changing state & widgets interacting with other widgets. Getting this wrong at the very beginning is a very costly mistake to make.
With this blog, you’ll be armed with the tools that you need to be able to make an effective choice at the very beginning. So get ready!
Pragmatic Way of Managing State in Flutter
State Management
Journey through different approaches in state management
Demo Application
Different Flutter State Management Techniques
Resources
✅ Understandable / readable / maintainable
✅ Testing
✅ Performance
If I have a widget, and I want to change its state from somewhere outside of that widget, either from another widget, or from the network, or a system call.
UI is a function of State
So let’s build a very simple app. It shows the pie chart, and there is a slider, All we want to do is change the state of the pie chart in response to something happening in the slider.
If we look at the very simplified widget tree,we have, basically, only three widgets —
And my slider wants to change the state of my chart.
So we do something that we call in any declarative framework lifting state up. So we lift state up using — my schedule
As soon as slider change —
hey, you know what? I was tapped, and this value changed
hey, something changed, and my chart redraws
hey, this thing actually changed, and then it changed to my slider
#dart #state-management #android #apps #flutter