isNumber property

bool get isNumber

Checks whether the String is a number.

Example

String foo = '45';
bool isNumber = foo.isNumber; // returns true
String foo = '45s';
String isNumber = foo.isNumber; // returns false

Implementation

bool get isNumber => isNotBlank && isNumberOrBlank;