Check if string contains only numbers
text - The text to validate Returns true if text contains only numbers
text
static bool isNumbersOnly(String text) { return RegExp(r'^[0-9]+$').hasMatch(text); }