parse static method

(OutputMode?, String?) parse(
  1. String value
)

Parses the name of a mode, returning the error for an unknown one

Implementation

static (OutputMode?, String?) parse(String value) {
  for (OutputMode mode in values) {
    if (mode.name == value) return (mode, null);
  }
  return (null, "'$value' is not a valid output. The valid values are: $names");
}