match<T> method
T
match<T>({
- required T fromAsset(
- KeyFromAsset value
- required T fromFile(
- KeyFromFile value
- required T fromString(
- KeyFromString value
Implementation
T match<T>({
required T Function(KeyFromAsset value) fromAsset,
required T Function(KeyFromFile value) fromFile,
required T Function(KeyFromString value) fromString,
}) {
return switch (this._index) {
0 => fromAsset(this._value as KeyFromAsset),
1 => fromFile(this._value as KeyFromFile),
2 => fromString(this._value as KeyFromString),
_ => throw NativeException("Unrecognized case index ${this._index}")
};
}