toDouble property

double? toDouble

Converts the string to a double. Returns null if the conversion fails.

Example:

print('12.34'.toDouble); // Output: 12.34
print('abc'.toDouble); // Output: null

Implementation

double? get toDouble => toNum?.toDouble();