match<T> method
T
match<T>({
- required T objectHandler(
- SuggestObjectHandler? value
- required T performSearchHandler(
- PerformSearchHandler? value
- required T incompleteTextHandler(
- IncompleteTextHandler? value
Implementation
T match<T>({
required T Function(SuggestObjectHandler? value) objectHandler,
required T Function(PerformSearchHandler? value) performSearchHandler,
required T Function(IncompleteTextHandler? value) incompleteTextHandler,
}) {
return switch (this._index) {
0 => objectHandler(this._value as SuggestObjectHandler?),
1 => performSearchHandler(this._value as PerformSearchHandler?),
2 => incompleteTextHandler(this._value as IncompleteTextHandler?),
_ => throw NativeException("Unrecognized case index ${this._index}")
};
}