byName static method
- String? name
Gets a possible NavigationActionPolicy instance value with name name.
Goes through NavigationActionPolicy.values looking for a value with
name name, as reported by NavigationActionPolicy.name.
Returns the first value with the given name, otherwise null.
Implementation
static NavigationActionPolicy? byName(String? name) {
if (name != null) {
try {
return NavigationActionPolicy.values.firstWhere(
(element) => element.name() == name,
);
} catch (e) {
return null;
}
}
return null;
}