isValidUsername property

bool get isValidUsername

Validates if the string is a valid username. Rules: Only alphanumeric characters, underscores, and min length of 3.

Implementation

bool get isValidUsername {
  return RegExp(r'^[a-zA-Z0-9_]{3,}$').hasMatch(this);
}