isAlphabetsOnly static method

bool isAlphabetsOnly(
  1. String text
)

Check if string contains only alphabets

text - The text to validate Returns true if text contains only alphabets

Implementation

static bool isAlphabetsOnly(String text) {
  return RegExp(r'^[a-zA-Z\s]+$').hasMatch(text);
}