toTryDouble method
Tries to parse the string to a double. Returns null if parsing fails.
Example:
'3.14'.toTryDouble(); // returns 3.14
'pi'.toTryDouble(); // returns null
value?.toString().toTryDouble(); // returns null or double value
Implementation
double? toTryDouble() => double.tryParse(this);