tokenName static method

String? tokenName(
  1. String? value
)

Implementation

static String? tokenName(String? value) {
  if (value != null) {
    if (value.isEmpty) {
      return 'Token name can\'t be empty';
    }
    if (!tokenNameRegExp.hasMatch(value)) {
      return 'Token name must contain only alphanumeric characters';
    }
    if (value.length > tokenNameMaxLength) {
      return 'Token name must have maximum $tokenNameMaxLength characters';
    }
    return null;
  } else {
    return 'Value is null';
  }
}