isNumber static method
Returns true for a valid numeric string (integer or decimal).
Implementation
static bool isNumber(String value) {
final RegExp regex = RegExp(r'^[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?$');
return regex.hasMatch(value.trim());
}