State management سے مراد ہے کہ ایک ایپ اپنے data (state) کو کیسے manage اور update کرتی ہے اور UI میں تبدیلیوں کو کیسے ظاہر کرتی ہے۔ جیسے جیسے ایپس بڑی ہوتی ہیں، state کو اچھی طرح manage کرنا اہم ہو جاتا ہے، اور Flutter built-in mechanisms (setState) اور بہت سی libraries (Provider, Riverpod, Bloc) فراہم کرتا ہے۔
State کیا ہے
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.
