fromName static method
Returns the ResourceCode associated with the given name
.
Returns null
if no match is found.
Implementation
static ResourceCode? fromName(String? name, {ResourceCode? orElse}) {
try {
return values.firstWhere(
(element) => element.name == name,
orElse: orElse == null ? null : () => orElse,
);
} on StateError {
return null;
}
}