A type of observers that subscribes itself to the target State's lifecycle.
Like ordinary observers, an active observer listens from one or many observables
and reactive to the events, but the subscription is managed by the active observer
rather than the observable. After subscription, data still flows from the observable
to the observer.
The word "active" means the observer acts actively, rather than "passively": [...]
Run callback after initial paint, then call it again when this state
is updated and rerunWhen returns true.
Since callback is called after paint, it can read geometric information in
current and descendant widgets.
Notice: this observer will not be triggered by paints caused by parent
widgets, e.g. constraint updates from parent widget.
effect will be called in State's initState.
effect should return a callback that will be called in dispose. Typically,
the callback should contain effect's clean up logic.
Whenever the widget is updated(didUpdateWidget), if restartWhen returns false
the callback returned by previous effect will be called to clean up previous
effect , then effect is called again. tl;dr effect will be restarted.