DataNotification<T> class

A notification representing a data event from a Stream.

Inheritance
Available extensions

Constructors

DataNotification(T value)
Constructs a DataNotification with the provided value.
const

Properties

dataValueOrNull → T?

Available on StreamNotification<T>, provided by the StreamNotificationExtensions extension

Returns data if kind is NotificationKind.data, otherwise returns null.
no setter
errorAndStackTraceOrNull ErrorAndStackTrace?

Available on StreamNotification<T>, provided by the StreamNotificationExtensions extension

Returns error and stack trace if kind is NotificationKind.error, otherwise returns null.
no setter
hashCode int
The hash code for this object.
no setteroverride
isData bool

Available on StreamNotification<T>, provided by the StreamNotificationExtensions extension

A test to determine if this StreamNotification wraps a data event.
no setter
isDone bool

Available on StreamNotification<T>, provided by the StreamNotificationExtensions extension

A test to determine if this StreamNotification wraps a done event.
no setter
isError bool

Available on StreamNotification<T>, provided by the StreamNotificationExtensions extension

A test to determine if this StreamNotification wraps an error event.
no setter
kind NotificationKind
References the NotificationKind of this StreamNotification event.
finalinherited
requireDataValue → T

Available on StreamNotification<T>, provided by the StreamNotificationExtensions extension

Returns data if kind is NotificationKind.data, otherwise throws a TypeError error. See also dataValueOrNull.
no setter
requireErrorAndStackTrace ErrorAndStackTrace

Available on StreamNotification<T>, provided by the StreamNotificationExtensions extension

Returns error and stack trace if kind is NotificationKind.error, otherwise throws a TypeError error.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value → T
The value of the data event.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override
when<R>({required R data(T value), required R done(), required R error(ErrorAndStackTrace)}) → R

Available on StreamNotification<T>, provided by the StreamNotificationExtensions extension

Invokes the appropriate function on the StreamNotification based on the kind.

Operators

operator ==(Object other) bool
The equality operator.
override