number static method
A number (12, -3, +5, .5, 1.5, 1e3, Infinity); null
otherwise. Hex (0x10) and NaN are no numbers.
Implementation
static double? number(String value) {
final text = value.trim();
if (text.toLowerCase() == 'infinity') {
return double.infinity;
}
return _numberPattern.hasMatch(text) ? double.tryParse(text) : null;
}