tryParse static method

ChatName? tryParse(
  1. String val
)

Parses the provided val as a ChatName, if val meets the validation, or returns null otherwise.

Implementation

static ChatName? tryParse(String val) {
  try {
    return ChatName(val);
  } catch (_) {
    return null;
  }
}