byName static method

Gets a possible IOSURLCredentialPersistence instance value with name name.

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

Implementation

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