fromString static method

ToolName fromString(
  1. String name
)

Resolve a wire identifier (e.g. 'tap_element') to its ToolName.

Throws ArgumentError when no enum value matches.

Implementation

static ToolName fromString(String name) {
  for (final v in ToolName.values) {
    if (v.wireName == name || v.name == name) return v;
  }
  throw ArgumentError('Unknown tool name: $name');
}