Variant2<T0, T1> class
sealed
A type-safe discriminated union holding either T0 or T1.
- Implementers
Constructors
- Variant2.withT0(T0 value)
-
Creates a variant holding a
T0value.factory - Variant2.withT1(T1 value)
-
Creates a variant holding a
T1value.factory
Properties
Methods
-
holdsAlternative<
T> () → bool - Checks if the variant currently holds the specified type alternative.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
visit<
R> ({required R onT0(T0), required R onT1(T1)}) → R - Visits the underlying value with exhaustive matching.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited