isInt method

bool isInt()

Checks if the String is an integer.

Example:

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

Implementation

bool isInt() => isEmptyOrNull ? false : int.tryParse(this!) != null;