isAlphanumeric static method

bool isAlphanumeric(
  1. String input
)

Validates if the given string contains only alphanumeric characters.

Implementation

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