An IDE quick-fix refactoring tool (Dart Assist) that automatically migrates a positional or named
Watch constructor call to use the modern, type-safe SignalBuilder
component.
:::important
The Watch widget was updated and aligned under the standard SignalBuilder
paradigm in v7.
This automated refactoring quick-fix updates your positional widget structure to a type-safe
SignalBuilder(builder: (context) => ...) signature seamlessly.
:::
How to use#
- Place your cursor on the
Watchconstructor call. -
Click the lightbulb icon or press your IDE's quick-fix shortcut (
Alt+EnterorCmd+.). - Select the Migrate Watch to SignalBuilder assist option.
Examples#
Before:
Widget build(BuildContext context) {
return Watch((context) => Text('${counter.value}')); // LINT: Positional Watch
}
After (Apply Assist):
Widget build(BuildContext context) {
return SignalBuilder(builder: (context) => Text('${counter.value}')); // OK
}