tryParse static method
- String val
Parses the provided val as a UserName, if val meets the validation,
or returns null otherwise.
Implementation
static UserName? tryParse(String val) {
try {
return UserName(val);
} catch (_) {
return null;
}
}