← Flutter & Dart learning pathFlutter & Dart · Module 7 of 10
State management
Share state across screens with Provider, Riverpod or Bloc.
📖 Key ideas
- setState is fine for local widget state.
- Provider/ChangeNotifier shares app state.
- Riverpod is a safer, testable successor to Provider.
- Bloc uses events and states with streams.
- Pick one approach and use it consistently.
💡 Real-life example: State management is a shared notice board: update it once and all screens read the same notice.
ProviderSimple DI and state package
ChangeNotifierClass that notifies listeners
RiverpodCompile-safe state management
BlocEvent-driven state pattern