La gestione dello stato si riferisce a come un'app gestisce e aggiorna i suoi dati (state) e riflette le modifiche nell'interfaccia utente. Man mano che le app crescono, gestire bene lo stato diventa importante, e Flutter offre meccanismi integrati (setState) e molte librerie (Provider, Riverpod, Bloc) per farlo.
Che cos'è lo stato
STATE = data that can change and affects the UI:
→ UI state: is a checkbox checked? what's in a text field? is a menu open?
→ app state: the logged-in user, items in a cart, fetched data
→ When state changes, the UI must UPDATE to reflect it.
