TypeToken<S> class

A class that captures the Type to filter down to using ofType or cast.

Given the way Dart generics work, one cannot simply use the is T / as T checks and castings within an ofTypeObservable itself. Therefore, this class was introduced to capture the type of class you'd like ofType to filter down to, or cast to cast to.

Example

new Stream.fromIterable([1, "hi"])
  .ofType(new TypeToken<String>)
  .listen(print); // prints "hi"

Constructors

TypeToken()
const

Properties

hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

isType(dynamic other) → bool
toType(dynamic other) → S
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator.
inherited