Skip to content

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Dec 30, 2025

Bumps watch_it from 1.7.0 to 2.0.0.

Changelog

Sourced from watch_it's changelog.

2.0.0 - Performance optimizations and post-frame callbacks

Breaking Changes

  • BREAKING: Replaced dependency functional_listener ^4.0.0 with listen_it ^5.1.0. This is a breaking change as functional_listener has been renamed and restructured into listen_it. If you use functional_listener operators in your code, update your imports from package:functional_listener/functional_listener.dart to package:listen_it/listen_it.dart.
  • BREAKING: watchValue() and registerHandler() now default to allowObservableChange: false for 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), set allowObservableChange: true. This prevents common memory leaks from inline chain creation like watchValue((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 using WidgetsBinding.instance.addPostFrameCallback in initState().
  • 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 a cancel() function to stop future invocations when needed.

Performance Improvements

  • watchValue() and registerHandler() now have zero overhead on rebuilds with default settings - selectors are only called once instead of on every build
  • Added helpful StateError messages when observables change unexpectedly with allowObservableChange: false, guiding users to the correct fix

Bug Fixes

  • Fixed createOnceAsync test isolation issue by properly resetting testCompleter in setUp
  • Internal refactoring: Renamed parameters for better clarity (targetparentOrListenable, etc.)
Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [watch_it](https://github.com/flutter-it/watch_it) from 1.7.0 to 2.0.0.
- [Changelog](https://github.com/flutter-it/watch_it/blob/main/CHANGELOG.md)
- [Commits](https://github.com/flutter-it/watch_it/commits/V2.0.0)

---
updated-dependencies:
- dependency-name: watch_it
  dependency-version: 2.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added dart Pull requests that update Dart code dependencies Pull requests that update a dependency file labels Dec 30, 2025
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Dec 30, 2025
@MrCsabaToth MrCsabaToth merged commit a4e9dfb into develop Dec 30, 2025
@dependabot dependabot bot deleted the dependabot/pub/watch_it-2.0.0 branch December 30, 2025 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dart Pull requests that update Dart code dependencies Pull requests that update a dependency file size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants