Either2<T1, T2> class

Represents either a T1 or T2.

This class is used for fields generated from the LSP/DAP specs that are defined as unions in TypeScript (for example String | number) that cannot directly be represented as Dart types.

Use the map function to access the element, providing a handler for each of the possible types.

Inheritance

Constructors

Either2.t1(T1 _t1)
Either2.t2(T2 _t2)

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

map<T>(T f1(T1), T f2(T2)) → T
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Object?
override
toString() String
A string representation of this object.
override
valueEquals(dynamic o) bool
Checks whether the value of the union equals the supplied value.

Operators

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