Version: 4.4.1
Configuration
How it works?#
You have to ways to manage the state of your widgets or pages:
- Using a
SimpleNotifiersimiliar toChangeNotifierfor a simple state. - Using a
StateNotifierfor complex states.
Auto dispose feature#
The life cycle of a SimpleNotifier or a StateNotifier by default is attached to one Route. It means that our notifiers will be disposed when the route who created the SimpleNotifier or a StateNotifier is popped.
First flutter_meedu needs to listen the changes in your route navigator. This is very simple in your main.dart file add the next code
main.dart
With Navigator 2.0
If you are using navigator 2.0 or any package to navigate using navigator 2.0 to enable the auto dispose feature you must add the meedu observer (router.observer) inside the navigatorObservers of your delegate or your Navigator widget.