Username constructor

Username(
  1. String urlOrUsername
)

Initializes an instance of Username.

Implementation

factory Username(String urlOrUsername) {
  final username = parseUsername(urlOrUsername);
  if (username == null) {
    throw ArgumentError.value(
        urlOrUsername, 'urlOrUsername', 'Invalid username');
  }
  return Username._(username);
}