isValidUsername static method
Implementation
static bool isValidUsername(
String? username, {
bool withDot = true,
RegExp? pattern,
}) {
if (username != null && username.isNotEmpty) {
if (withDot) {
return (pattern ?? Patterns.usernameWithDot).hasMatch(username);
} else {
return (pattern ?? Patterns.username).hasMatch(username);
}
} else {
return false;
}
}