match<T> method

T match<T>({
  1. required T activeLevel(
    1. ActiveLevelMode value
    ),
  2. required T overview(
    1. OverviewMode value
    ),
})

Implementation

T match<T>({
  required T Function(ActiveLevelMode value) activeLevel,
  required T Function(OverviewMode value) overview,
}) {
  return switch (this._index) {
    0 => activeLevel(this._value as ActiveLevelMode),
    1 => overview(this._value as OverviewMode),
    _ => throw NativeException("Unrecognized case index ${this._index}")
  };
}