when method

void when({
  1. required void onConstantFunctionPoints(
    1. StylingConstantFunctionPoints value
    ),
  2. required void onLinearZoomFunctionPoints(
    1. StylingLinearZoomFunctionPoints value
    ),
  3. required void onLinearTiltFunctionPoints(
    1. StylingLinearTiltFunctionPoints value
    ),
  4. required void onBilinearFunctionMatrix(
    1. StylingBilinearFunctionMatrix value
    ),
})

Applies the passed function to the variant value.

Implementation

void when({
  required void Function(StylingConstantFunctionPoints value)
      onConstantFunctionPoints,
  required void Function(StylingLinearZoomFunctionPoints value)
      onLinearZoomFunctionPoints,
  required void Function(StylingLinearTiltFunctionPoints value)
      onLinearTiltFunctionPoints,
  required void Function(StylingBilinearFunctionMatrix value)
      onBilinearFunctionMatrix,
}) {
  if (_value is StylingConstantFunctionPoints) {
    return onConstantFunctionPoints(_value as StylingConstantFunctionPoints);
  }
  if (_value is StylingLinearZoomFunctionPoints) {
    return onLinearZoomFunctionPoints(
        _value as StylingLinearZoomFunctionPoints);
  }
  if (_value is StylingLinearTiltFunctionPoints) {
    return onLinearTiltFunctionPoints(
        _value as StylingLinearTiltFunctionPoints);
  }
  if (_value is StylingBilinearFunctionMatrix) {
    return onBilinearFunctionMatrix(_value as StylingBilinearFunctionMatrix);
  }
  assert(false);
}