validateUsername static method

bool validateUsername(
  1. String name
)

Returns true if the given username is a valid username.

Implementation

static bool validateUsername(String name) {
  if (name.isNullOrWhiteSpace) {
    return false;
  }

  if (name.length > 20) {
    return false;
  }

  return true;
}