watch_it
The simple state management powered by get_it. It allows to observe changes of objects inside the get_it service locator and rebuild the UI accordingly.
2.4.2
9.8K downloads/mo
#2966 most downloaded on pub.dev
flutter-it/watch_it
What this package is like to depend on
Last release 6 months ago
20 Feb 2026
Release timing varies
gaps range from 8 days to 5 months
Most releases are documented
notes for 32 of 36 stable releases
Nothing withdrawn
no release was ever pulled
3 years old
36 releases · first in 2023
9 releases in the last 12 months
see the full history below
Release timeline
36 releases · Apr 2023 to Feb 2026Releases
latest 36-
2.4.220 Feb 2026Release notes
Open source →- Added AI skill files in
skills/directory for AI coding assistants - Added AI-Assisted Development section to README
- Added AI skill files in
-
2.4.104 Dec 2025Release notes
Open source →Bug Fixes
- Fixed
allReady()returning staletruevalue when new async singletons are registered- Now correctly returns
falseand shows loading state until new singletons complete
- Now correctly returns
- Fixed
-
2.4.004 Dec 2025Release notes
Open source →- allReady() now properly detects when new async singletons are registered in pushed scopes
- Works with get_it 9.2.0's cached allReady() future
- Requires get_it ^9.2.0
Release notes
Open source →Improvements
allReady()now properly detects when new async singletons are registered in pushed scopes- Previously,
allReady()would not rebuild the UI whenpushNewScope()registered new async singletons - Now works correctly with get_it 9.2.0's cached
allReady()future
- Previously,
- Requires get_it ^9.2.0
-
2.3.125 Nov 2025 -
2.2.019 Nov 2025Release notes
Open source →The new name better reflects the actual behavior: it executes once after
the first build where the function is called, not necessarily after the
widget's first build. This makes it clear that it can be safely used
inside conditionals.Enhanced documentation with better explanation of behavior and added
example showing usage in conditionals for navigation when async
dependencies are ready.Version: 2.2.0
Release notes
Open source →Improvements
- Renamed for clarity:
callAfterFirstBuild()→callOnceAfterThisBuild(). The new name better reflects the actual behavior: it executes once after the first build where the function is called, not necessarily after the widget's first build. This makes it clear that it can be safely used inside conditionals. Since this function was only introduced in version 2.0.0, migration should be straightforward - just update the function name in your code. - Enhanced documentation for
callOnceAfterThisBuild()with better explanation of behavior and added example showing usage in conditionals for navigation when async dependencies are ready.
- Renamed for clarity:
-
2.1.115 Nov 2025Release notes
Open source →Maintenance
- Updated example to use command_it 9.0.2 API (
execute→run,isExecuting→isRunning)
- Updated example to use command_it 9.0.2 API (
-
2.1.008 Nov 2025Release notes
Open source →- Improved error messages for watch ordering violations with clear guidance
- Added comprehensive watch ordering documentation to README
- Increased test coverage to 93.3%
Release notes
Open source →Improvements
- Better Error Messages: Watch ordering violations now show a helpful error message instead of cryptic type errors. When conditional watch calls are placed incorrectly, you'll see clear guidance on how to fix it with BAD/GOOD examples.
- Enhanced Documentation: Added "Watch Ordering and Conditional Watches" section to README with visual examples explaining why conditional watches must be at the end of build methods.
- Improved Test Coverage: Test coverage increased to 93.3%.
-
2.0.103 Nov 2025Release notes
Open source →Maintenance
- Updated get_it dependency to ^9.0.0
- Added GitHub Actions workflow for CI/CD with automated testing and code coverage
- Improved README header with logo and better formatting to match flutter_it ecosystem style
- Added package logo to pub.dev screenshots
-
2.0.002 Nov 2025Release notes
Open source →New Features:
- Add callAfterFirstBuild() for executing callbacks after first frame render
- Add callAfterEveryBuild() with cancel callback for per-rebuild operations
- Add const_widget_test.dart to verify const widgets work with WatchItMixin
Breaking Changes:
- Migrate from functional_listener to listen_it dependency
- Change watchValue() and registerHandler() to default allowObservableChange: false
for better performance and memory leak prevention
Performance Improvements:
- Selectors now only called once on first build (zero overhead on rebuilds)
- Add helpful StateError messages for unexpected observable changes
Bug Fixes:
- Fix createOnceAsync test isolation issue
Tests: All 57 tests passing
Release notes
Open source →Breaking Changes
- BREAKING: Replaced dependency
functional_listener ^4.0.0withlisten_it ^5.1.0. This is a breaking change asfunctional_listenerhas been renamed and restructured intolisten_it. If you usefunctional_listeneroperators in your code, update your imports frompackage:functional_listener/functional_listener.darttopackage:listen_it/listen_it.dart. - BREAKING:
watchValue()andregisterHandler()now default toallowObservableChange: falsefor better performance and memory leak prevention. This means the selector function is only called once on first build. If you need to dynamically switch observables (e.g.,condition ? obsA : obsB), setallowObservableChange: true. This prevents common memory leaks from inline chain creation likewatchValue((m) => m.source.map(...)).
New Features
- Added
callAfterFirstBuild()function that executes a callback once after the first frame has been rendered. This is useful for operations that require the widget tree to be fully built and laid out, such as showing dialogs, accessing widget dimensions, scrolling to positions, or starting animations that depend on final widget sizes. This replaces the common pattern of usingWidgetsBinding.instance.addPostFrameCallbackininitState(). - Added
callAfterEveryBuild()function that executes a callback after every frame has been rendered. This is useful for operations that need to run after each rebuild, such as updating scroll positions, repositioning overlays, or performing measurements. The callback includes acancel()function to stop future invocations when needed.
Performance Improvements
watchValue()andregisterHandler()now have zero overhead on rebuilds with default settings - selectors are only called once instead of on every build- Added helpful
StateErrormessages when observables change unexpectedly withallowObservableChange: false, guiding users to the correct fix
Bug Fixes
- Fixed
createOnceAsynctest isolation issue by properly resettingtestCompleterinsetUp - Internal refactoring: Renamed parameters for better clarity (
target→parentOrListenable, etc.)
-
1.7.021 Aug 2025Nothing published for this version
-
1.6.511 Mar 2025Release notes
Open source →- PR by @timmaffett imrproving the markdown of the readme
- adding topics to pubspec
-
1.6.425 Feb 2025 -
1.6.322 Feb 2025Release notes
Open source →- fixing an exception in Streambuilder during loading state if you don't provide an inital value
-
1.6.209 Jan 2025 -
1.6.113 Dec 2024 -
1.6.012 Dec 2024 -
1.5.129 Sep 2024Nothing published for this version
-
1.5.020 Sep 2024Nothing published for this version
-
1.4.214 May 2024Nothing published for this version
-
1.4.123 Mar 2024 -
1.4.023 Jan 2024Release notes
Open source →- thanks to the pr https://github.com/escamoteur/watch_it/pull/27 by @jefflongo
pushScopenow accepts theisFinalparameter that the underlying get_it function does for some time now.
- thanks to the pr https://github.com/escamoteur/watch_it/pull/27 by @jefflongo
-
1.3.018 Jan 2024Release notes
Open source →- added
executeHandlerOnlyOncetoregisterFutureHandler,allReadyandallReadyHandler - added new functions:
callOnceandonDispose. See readme for details
- added
-
1.2.027 Dec 2023Release notes
Open source →- thanks to the PR from @smjxpro https://github.com/escamoteur/watch_it/pull/22 you now can register handlers for pure Listenable/ChangeNotifiers too
-
1.1.008 Nov 2023Release notes
Open source →- https://github.com/fluttercommunity/get_it/issues/345
allReady()will now throw a correct error if an exception is thrown in one of the factory functions thatallReady()checks
- https://github.com/fluttercommunity/get_it/issues/345
-
1.0.631 Oct 2023 -
1.0.525 Sep 2023 -
1.0.411 Sep 2023Release notes
Open source →- added some more asserts to provide better error messages in case you forgot to use the WatchItMixin
-
1.0.304 Sep 2023 -
1.0.203 Sep 2023Release notes
Open source →- thanks for PR by @yangsfang https://github.com/escamoteur/watch_it/pull/10
-
1.0.131 Aug 2023 -
1.0.024 Aug 2023Release notes
Open source →- fix for https://github.com/escamoteur/watch_it/issues/8
- improved comments thanks to PR by @kevlar700
-
0.9.308 Aug 2023Release notes
Open source →- added safety checks in case _element gets null but still a handler might get called
-
0.9.215 Jun 2023 -
0.9.115 Jun 2023 -
0.9.015 Jun 2023 -
0.0.126 Apr 2023Release notes
Open source →- This is currently just a placeholder for the new version of the get_it_mixin