SignalsWatch<T>.select constructor
const
SignalsWatch<T>.select (
- ReadonlySignal signal, {
- Key? key,
- required T selector(
- dynamic value
- required Widget builder(
- T value
- Function? onInit,
- Function? onValueUpdated,
- Function? onAfterBuild,
- Function? onDispose,
- bool shouldRebuild(
- T newValue,
- T oldValue
- bool shouldNotify(
- T newValue,
- T oldValue
- bool equals(
- T a,
- T b
- Duration? debounce,
- Duration? throttle,
- void onError(
- Object error,
- StackTrace stackTrace
- Widget errorBuilder(
- Object error
- Widget loadingBuilder()?,
- String? debugLabel,
- bool debugPrint = false,
Create a SignalsWatch with a selector for efficient updates. Only rebuilds when the selected value changes (compared via equals).
Implementation
const SignalsWatch.select(
ReadonlySignal<dynamic> signal, {
super.key,
required T Function(dynamic value) selector,
required this.builder,
this.onInit,
this.onValueUpdated,
this.onAfterBuild,
this.onDispose,
this.shouldRebuild,
this.shouldNotify,
this.equals,
this.debounce,
this.throttle,
this.onError,
this.errorBuilder,
this.loadingBuilder,
this.debugLabel,
this.debugPrint = false,
}) : assert(
debounce == null || throttle == null,
'Cannot use both debounce and throttle simultaneously',
),
_signal = signal,
_selector = selector,
_signals = null,
_combine = null,
_read = null;