Does stateful widgets make sense in a Redux/Flutter app?

Viewed 630

I am studying Redux combining it with Flutter, and I have this question, does making stateful widgets make sense in Flutter if you follow redux architecture? I could think that for animations and little widgets it's better to make a stateful widget rather than a new attribute to the real appState, but I am not really sure... I need someone to clarify me this dummy question.

2 Answers

Redux is not even close to replacing StatefulWidget.

A simple example is animations. Each of them requires to store, dispose and interact with an AnimationController/Tweens.

Redux really is for a serializable state. Typically what comes from your API, which you may or may not want to store on the device.

StatefulWidget kicks in for everything else.

Definitely. Use stateful widget for rather short-lived UI state and Redux for longer-living state and state managed by business logic.

Related