isOnlySpecialCharacters method

bool isOnlySpecialCharacters(
  1. String text
)

Implementation

bool isOnlySpecialCharacters(String text) {
  if (text.isEmpty) return false;
  final RegExp alphanumeric = RegExp(r'[a-zA-Z]');
  // If there are no alphanumeric characters, it's only special characters
  return !alphanumeric.hasMatch(text);
}