toDouble method

double? toDouble()

Returns either double or null.

"xyz".toDouble();   // null
"12.45".toDouble(); // 12.45

Implementation

double? toDouble() => double.tryParse(this);