SignalsWatch<T>.fromSignals constructor
SignalsWatch<T>.fromSignals (
- List<
ReadonlySignal> signals, { - Key? key,
- required T combine(
- List values
- 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 from multiple signals with batch updates.
Implementation
SignalsWatch.fromSignals(
List<ReadonlySignal<dynamic>> signals, {
super.key,
required T Function(List<dynamic> values) combine,
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(signals.isNotEmpty, 'signals list cannot be empty'),
assert(
debounce == null || throttle == null,
'Cannot use both debounce and throttle simultaneously',
),
_signals = signals,
_combine = combine,
_signal = null,
_read = null,
_selector = null;