isValidName property

bool get isValidName

Accepts Unicode letters, spaces, hyphens, apostrophes, periods. Single names (mononyms) are valid. Max 100 chars guards against abuse.

Implementation

bool get isValidName {
  final s = trim();
  if (s.isEmpty || s.length > 100) return false;
  // Unicode letter categories + common name punctuation
  final re = RegExp(r"^[\p{L}\p{M}' .\-]+$", unicode: true);
  return re.hasMatch(s);
}