SignalBuilder API docs

Reacts to the signal calling the builder each time.

dart
final counter = Signal(0);

@override
Widget build(BuildContext context) {
  return SignalBuilder(
    builder: (context, child) {
      return Text('${counter.value}');
    },
  );
}

Constructor

dart
SignalBuilder({
  required ValueWidgetBuilder<T> builder,
  Widget? child,
});

builder is the function that builds the widget and automatically reacts to any signal value changes.

child is optional and can be null if the entire widget subtree the builder builds depends on the value of the signals. This widget will be passed to the builder and DOESN'T rebuilds if the value of the signals changes.

On this page