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