SignalsWatch<T>.fromSignal constructor

const SignalsWatch<T>.fromSignal(
  1. ReadonlySignal<T> signal, {
  2. Key? key,
  3. required Widget builder(
    1. T value
    ),
  4. Function? onInit,
  5. Function? onValueUpdated,
  6. Function? onAfterBuild,
  7. Function? onDispose,
  8. bool shouldRebuild(
    1. T newValue,
    2. T oldValue
    )?,
  9. bool shouldNotify(
    1. T newValue,
    2. T oldValue
    )?,
  10. bool equals(
    1. T a,
    2. T b
    )?,
  11. Duration? debounce,
  12. Duration? throttle,
  13. void onError(
    1. Object error,
    2. StackTrace stackTrace
    )?,
  14. Widget errorBuilder(
    1. Object error
    )?,
  15. Widget loadingBuilder()?,
  16. String? debugLabel,
  17. bool debugPrint = false,
})

Create a SignalsWatch from a single signal.

Implementation

const SignalsWatch.fromSignal(
  ReadonlySignal<T> signal, {
  super.key,
  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,
      _signals = null,
      _combine = null,
      _read = null,
      _selector = null;