bindComputed<T> function
- @Deprecated('use SignalsMixin > bindComputed instead')
- BuildContext context,
- Computed<
T> target, { - String? debugLabel,
Bind an existing computed to a widget.
class State extends ... {
late final count = createSignal(context, 0);
late final isEven = computed(() => count().isEven);
late final even = bindComputed(context, isEven);
@override
Widget build(BuildContext context) {
return Row(
children: [
IconButton(icon: Icon(Icons.remove), onPressed: () => count.value--),
Text('$count, even=$even'),
IconButton(icon: Icon(Icons.add), onPressed: () => count.value++),
],
);
}
}
Implementation
@Deprecated('use SignalsMixin > bindComputed instead')
Computed<T> bindComputed<T>(
BuildContext context,
Computed<T> target, {
String? debugLabel,
}) {
return bindSignal<T, Computed<T>>(
context,
target,
debugLabel: debugLabel,
);
}