StreamNotification<T> class
abstract
A class that encapsulates the NotificationKind of event, value of the event in case of onData, or the Error in the case of onError. A container object that wraps the NotificationKind of event (OnData, OnDone, OnError), and the item or error that was emitted. In the case of onDone, no data is emitted as part of the StreamNotification.
- Implementers
- Available extensions
Constructors
- StreamNotification.data(T value)
-
Constructs a StreamNotification with NotificationKind.data and wraps a
value
factory - StreamNotification.done()
-
Constructs a StreamNotification with NotificationKind.done.
constfactory
- StreamNotification.error(Object error, [StackTrace? stackTrace])
-
Constructs a StreamNotification with NotificationKind.error and wraps an
error
andstackTrace
factory
Properties
- dataValueOrNull → T?
-
Available on StreamNotification<
Returns data if kind is NotificationKind.data, otherwise returns null.T> , provided by the StreamNotificationExtensions extensionno setter - errorAndStackTraceOrNull → ErrorAndStackTrace?
-
Available on StreamNotification<
Returns error and stack trace if kind is NotificationKind.error, otherwise returns null.T> , provided by the StreamNotificationExtensions extensionno setter - hashCode → int
-
The hash code for this object.
no setterinherited
- isData → bool
-
Available on StreamNotification<
A test to determine if this StreamNotification wraps a data event.T> , provided by the StreamNotificationExtensions extensionno setter - isDone → bool
-
Available on StreamNotification<
A test to determine if this StreamNotification wraps a done event.T> , provided by the StreamNotificationExtensions extensionno setter - isError → bool
-
Available on StreamNotification<
A test to determine if this StreamNotification wraps an error event.T> , provided by the StreamNotificationExtensions extensionno setter - kind → NotificationKind
-
References the NotificationKind of this StreamNotification event.
final
- requireDataValue → T
-
Available on StreamNotification<
Returns data if kind is NotificationKind.data, otherwise throws a TypeError error. See also dataValueOrNull.T> , provided by the StreamNotificationExtensions extensionno setter - requireErrorAndStackTrace → ErrorAndStackTrace
-
Available on StreamNotification<
Returns error and stack trace if kind is NotificationKind.error, otherwise throws a TypeError error.T> , provided by the StreamNotificationExtensions extensionno setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
when<
R> ({required R data(T value), required R done(), required R error(ErrorAndStackTrace)}) → R -
Available on StreamNotification<
Invokes the appropriate function on the StreamNotification based on the kind.T> , provided by the StreamNotificationExtensions extension
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited