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