StreamNotificationExtensions<T> extension

Provides extension methods on StreamNotification.

on

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
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
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

Methods

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.