Notification<T> class
A class that encapsulates the Kind of event, value of the event in case of onData, or the Error in the case of onError. A container object that wraps the Kind 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 Notification.
Constructors
- Notification(Kind kind, Object? _value, ErrorAndStackTrace? errorAndStackTrace)
-
Constructs a Notification which, depending on the
kind
, wraps eithervalue
, orerrorAndStackTrace
, or neither if it is just a Kind.onData event.const - Notification.onData(T value)
-
Constructs a Notification with Kind.onData and wraps a
value
factory - Notification.onDone()
-
Constructs a Notification with Kind.onDone
factory
- Notification.onError(Object error, StackTrace? stackTrace)
-
Constructs a Notification with Kind.onError and wraps an
error
andstackTrace
factory
Properties
- errorAndStackTrace → ErrorAndStackTrace?
-
The wrapped error and stack trace, if applicable
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- isOnData → bool
-
A test to determine if this Notification wraps an onData event
no setter
- isOnDone → bool
-
A test to determine if this Notification wraps an onDone event
no setter
- isOnError → bool
-
A test to determine if this Notification wraps an error event
no setter
- kind → Kind
-
References the Kind of this Notification event.
final
- requireData → T
-
Returns data if kind is Kind.onData, otherwise throws a StateError error.
no 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.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override