isNum method

bool isNum()

Checks if the String is an Number.

Example:

print("123".isNum()); // true
print("abc".isNum()); // false

Implementation

bool isNum() => isEmptyOrNull ? false : num.tryParse(this!) != null;