isAlphanumeric static method

bool isAlphanumeric(
  1. String text
)

Check if string is alphanumeric

text - The text to validate Returns true if text is alphanumeric

Implementation

static bool isAlphanumeric(String text) {
  return RegExp(r'^[a-zA-Z0-9]+$').hasMatch(text);
}