byName static method

SaveAsUIResult? byName(
  1. String? name
)

Gets a possible SaveAsUIResult instance value with name name.

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

Implementation

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