state_lifecycle_observer 0.0.3
state_lifecycle_observer: ^0.0.3 copied to clipboard
A reusable Flutter state observer pattern implementation.
0.0.3 #
- Enhancement: Introduced
safeSetStateinLifecycleObserverto handle state updates safely across different scheduler phases. - Fix:
FutureObserverandStreamObservernow usesafeSetStateto prevent errors when updates are triggered during build, layout, or paint phases. - Docs: Reorganized README to clearly categorize built-in observers (Base, Widget, Anim) and added clarification on
keyusage.
0.0.2 #
- Breaking Change: Renamed
onUpdatetoonDidUpdateWidgetto better align with Flutter's lifecycle naming. - Breaking Change: Removed
onInit. Initialization logic should be moved to the constructor orbuildTarget. - Enhancement: Added safety assertion to ensure
statemixes inLifecycleObserverMixin. - Docs: Updated README with
keyusage explanation and new API examples.
0.0.1 #
- Initial release.
- Added
LifecycleObserverbase class andLifecycleObserverMixin. - Included common observers:
AnimControllerObserver(supports fullAnimationControllerparams)ScrollControllerObserverTabControllerObserverTextEditingControllerObserver
- Implemented automatic lifecycle management (
onInit,onUpdate,onDispose). - Seamless integration via
super.build(context).