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.
Package selection guidance compiled from public package information, community data, and project usage.
Watch It is a lightweight state management solution for Flutter that leverages the get_it service locator to observe changes in registered objects and automatically rebuild the UI when those changes occur. By integrating seamlessly with get_it, it simplifies state updates without requiring complex boilerplate or additional widgets. Ideal for apps needing reactive behavior tied to service objects, Watch It promotes clean, maintainable code by reducing manual state handling. It supports all major Flutter platforms and works well in projects already using get_it.
Use cases
Reactive UI updates based on service state
Simplifying state management in small to medium apps
Observing changes in dependency-injected services
Real-time data synchronization in forms or lists
Reducing boilerplate in stateful widgets
Key features
Built on top of get_it
Automatic UI rebuilds on object changes
Minimal setup and integration
Cross-platform support
No need for additional state classes
Lightweight and fast
Suitable for
Developers using get_it
Projects with simple to moderate state needs
Teams seeking minimal state management overhead
Apps requiring reactive service updates
Flutter beginners exploring state solutions
Considerations
Best suited for non-complex state scenarios
Does not replace full state management solutions like Provider or Bloc
Requires careful management of observable objects
Limited debugging tools compared to dedicated state libraries
Not ideal for large-scale applications with complex state logic
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
The easiest state management for Flutter built on get_it
Widgets automatically rebuild when data changes. No ValueListenableBuilder, no StreamBuilder, no FutureBuilder—just watch your data and your UI stays in sync.
One line instead of 12. No nesting, no boilerplate. Watch multiple values without builder hell.
Part of flutter_it — A construction set of independent packages. watch_it + get_it is the recommended foundation. Add command_it and listen_it when you need them.
Why watch_it?
✨ Zero Boilerplate — No Builders, no setState, no widget tree nesting
⚡ Automatic Cleanup — Subscriptions disposed automatically when widget destroys
🎯 Type Safe — Catch errors at compile time with generics
🔧 Flexible Data Types — Works with Listenable, ValueListenable, Stream, Future
📊 Multiple Watches — Watch 3+ values without pyramid of doom
🧪 Test Friendly — Easy to mock and inject dependencies
Watching objects created by cached factories with parameters
If you have one manager per entity (e.g. per station id), register it with registerCachedFactoryParam and pass the parameter to the watch function. When the parameter changes, watch_it automatically unsubscribes from the old instance and subscribes to the new one:
di.registerCachedFactoryParam<StationManager, String, void>(
(stationId, _) => StationManager(stationId),
);
classStationTileextendsWatchingWidget{
finalString stationId;
constStationTile({super.key, requiredthis.stationId});
@overrideWidgetbuild(BuildContext context) {
final name = watchValue((StationManager m) => m.name, param1: stationId);
returnText(name);
}
}
param1/param2 are available on all watch and handler functions that resolve their object from get_it. They are only valid for types registered with registerCachedFactoryParam. Plain registerFactory registrations can't be watched at all (every build would get a new instance) and are rejected in debug mode.
Lifecycle Helpers
Powerful functions for StatelessWidgets:
createOnce — Create objects on first build, auto-dispose on widget destroy
Built on get_it — watch_it is designed to work with get_it's service locator pattern. Register your models, services, and business logic with get_it, then watch them reactively.
// Register with get_it
di.registerLazySingleton(() => UserManager());
di.registerLazySingleton(() => TodoManager());
// Watch them in any widgetclassMyWidgetextendsWatchingWidget{
@overrideWidgetbuild(BuildContext context) {
final user = watchIt<UserManager>();
final todos = watchValue((TodoManager m) => m.todos);
returnListView(...);
}
}
Want more? Combine with other flutter_it packages:
get_it — Recommended pairing. Service locator for dependency injection. Access global services with di<T>().
Optional: command_it — Command pattern with loading/error states. Watch Commands reactively for automatic UI updates.
💡 flutter_it is a construction set — watch_it + get_it is the recommended foundation. Add command_it and listen_it when you need advanced features. Each package works independently.
This package ships an Agent Skill for AI coding assistants
(Claude Code, Cursor, GitHub Copilot, Codex, Gemini CLI and others) in skills/watch-it-expert/.
It teaches them the critical rules, common patterns and anti-patterns of watch_it.
Install it into your project with the official Dart skills tool:
dart run skills@ get
dart run skills@ get only looks at direct dependencies. If you use get_it through watch_it, add get_it to your pubspec as well to also get get-it-expert.
For the ecosystem-wide skills (architecture guidance, feed/data-source patterns, overview)
and the skills of the other flutter_it packages run: