byName static method

SaveAsKind? byName(
  1. String? name
)

Gets a possible SaveAsKind instance value with name name.

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

Implementation

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