Watch<T extends Widget>.builder constructor

const Watch<T extends Widget>.builder({
  1. Key? key,
  2. required T builder(
    1. BuildContext context
    ),
  3. String? debugLabel,
  4. List<ReadonlySignal> dependencies = const [],
})

Drop in replacement for the Flutter builder widget.

final counter = signal(0);
...
- Builder(
+ Watch.builder(
  builder: (context) {
    return Text('$counter');
  }
)

Implementation

const Watch.builder({
  super.key,
  required this.builder,
  this.debugLabel,
  this.dependencies = const [],
});