match<T> method
T
match<T>({
- required T logicalPixel(
- LogicalPixel value
- required T scale(
- ModelScale value
Implementation
T match<T>({
required T Function(LogicalPixel value) logicalPixel,
required T Function(ModelScale value) scale,
}) {
return switch (this._index) {
0 => logicalPixel(this._value as LogicalPixel),
1 => scale(this._value as ModelScale),
_ => throw NativeException("Unrecognized case index ${this._index}")
};
}