isNumeric property

bool get isNumeric

Checks if the string contains only numeric characters.

Example:

'12345'.isNumeric; // true
'12.34'.isNumeric; // false

Implementation

bool get isNumeric => RegExp(r'^\d+$').hasMatch(this);