byName static method

WebStorageType? byName(
  1. String? name
)

Gets a possible WebStorageType instance value with name name.

Goes through WebStorageType.values looking for a value with name name, as reported by WebStorageType.name. Returns the first value with the given name, otherwise null.

Implementation

static WebStorageType? byName(String? name) {
  if (name != null) {
    try {
      return WebStorageType.values.firstWhere(
        (element) => element.name() == name,
      );
    } catch (e) {
      return null;
    }
  }
  return null;
}