isInt method

bool isInt()

Checks if the string represents an integer value.

Example:

print('10'.isInt()); // true
print('3.14'.isInt()); // false

Implementation

bool isInt() => int.tryParse(this) != null;