checkTextIsPhoneNumberCharsOnlyWithoutAbc static method

bool checkTextIsPhoneNumberCharsOnlyWithoutAbc(
  1. String text
)

this check it's like "0101234568" to be return true, if it hase any abc it will return false

Implementation

static bool checkTextIsPhoneNumberCharsOnlyWithoutAbc(String text) {
  // Null or empty string is not a number
  if (text == null || text.isEmpty) {
    return false;
  }

  // Try to parse input string to number.
  // Both integer and double work.
  // Use int.tryParse if you want to check integer only.
  // Use double.tryParse if you want to check double only.
  final number = num.tryParse(text);
  if (number == null) {
    return false;
  }
  return true;
}