# valueOf static method

ScopeType valueOf(

1. String name

)

Returns the ScopeType that matches the given `name`.

    final scope = ScopeType.valueOf("singleton");
    print(scope == ScopeType.SINGLETON); // true

Throws an IllegalArgumentException if no matching scope exists.

## Implementation

    static ScopeType valueOf(String name) {
      return switch (name.toLowerCase()) {
        'singleton' => SINGLETON,
        'prototype' => PROTOTYPE,
        _ => throw IllegalArgumentException('No ScopeType with name $name')
      };
    }