when method

void when({
  1. required void onVectorBooleanValue(
    1. List<SearchBusinessFilterBooleanValue> value
    ),
  2. required void onVectorEnumValue(
    1. List<SearchBusinessFilterEnumValue> value
    ),
  3. required void onRangeValue(
    1. SearchBusinessFilterRangeValue value
    ),
  4. required void onDateValue(
    1. SearchBusinessFilterDateValue value
    ),
})

Applies the passed function to the variant value.

Implementation

void when({
  required void Function(core.List<SearchBusinessFilterBooleanValue> value)
      onVectorBooleanValue,
  required void Function(core.List<SearchBusinessFilterEnumValue> value)
      onVectorEnumValue,
  required void Function(SearchBusinessFilterRangeValue value) onRangeValue,
  required void Function(SearchBusinessFilterDateValue value) onDateValue,
}) {
  if (_value is core.List<SearchBusinessFilterBooleanValue>) {
    return onVectorBooleanValue(
        _value as core.List<SearchBusinessFilterBooleanValue>);
  }
  if (_value is core.List<SearchBusinessFilterEnumValue>) {
    return onVectorEnumValue(
        _value as core.List<SearchBusinessFilterEnumValue>);
  }
  if (_value is SearchBusinessFilterRangeValue) {
    return onRangeValue(_value as SearchBusinessFilterRangeValue);
  }
  if (_value is SearchBusinessFilterDateValue) {
    return onDateValue(_value as SearchBusinessFilterDateValue);
  }
  assert(false);
}