fromStream<T> static method

Signal<T?> fromStream<T>(
  1. Stream<T> stream, {
  2. T? initialValue,
  3. String? debugLabel,
  4. bool autoDispose = false,
  5. bool cancelOnError = false,
  6. void onError(
    1. Object error,
    2. StackTrace stackTrace
    )?,
  7. Function? onInit,
  8. Function? onValueUpdated,
  9. Function? onAfterBuild,
  10. Function? onDispose,
  11. bool debugTrace = false,
  12. Map<String, dynamic>? metadata,
})

Create a signal from a Stream.

Optionally accepts lifecycle callbacks that will be used as defaults when observing this signal (widget-level callbacks override these).

Implementation

static s.Signal<T?> fromStream<T>(
  Stream<T> stream, {
  T? initialValue,
  String? debugLabel,
  bool autoDispose = false,
  bool cancelOnError = false,
  void Function(Object error, StackTrace stackTrace)? onError,
  Function? onInit,
  Function? onValueUpdated,
  Function? onAfterBuild,
  Function? onDispose,
  bool debugTrace = false,
  Map<String, dynamic>? metadata,
}) =>
    _signalFromStream<T>(
      stream,
      initialValue: initialValue,
      debugLabel: debugLabel,
      autoDispose: autoDispose,
      cancelOnError: cancelOnError,
      onError: onError,
      onInit: onInit,
      onValueUpdated: onValueUpdated,
      onAfterBuild: onAfterBuild,
      onDispose: onDispose,
      debugTrace: debugTrace,
      metadata: metadata,
    );