toDoubleList property

List<double> toDoubleList

Converts a comma-separated string into a List

Example:

print('1.0,2.0,3.0'.toDoubleList); // Output: [1.0, 2.0, 3.0]
print('1.0,a,3.0'.toDoubleList); // Output: [1.0, 3.0]

Implementation

List<double> get toDoubleList =>
    split(',').map((s) => double.tryParse(s)).where((i) => i != null).cast<double>().toList();