O Flutter tem várias abordagens de gerenciamento de estado — desde built-in (setState, InheritedWidget) até bibliotecas populares (Provider, Riverpod, Bloc, GetX). Entender as opções principais, suas filosofias e trade-offs ajuda a escolher a abordagem certa para um app.
Abordagens built-in
setState → local state in a StatefulWidget (simple; doesn't scale to shared state)
InheritedWidget → built-in way to share state down the tree (the foundation many
libraries build on; verbose to use directly)
Provider — simples e recomendado
PROVIDER → official-recommended, built on InheritedWidget; simple, widely used:
→ provide state at a point in the tree; descendants "watch"/consume it
→ ChangeNotifier holds state and notifies listeners → UI rebuilds on change
→ good for many apps; gentle learning curve
