toDouble static method

double? toDouble(
  1. dynamic value
)

Convert value to double

Implementation

static double? toDouble(dynamic value) {
  if (value == null) return null;
  if (value is num) return value.toDouble();
  if (value is String) return double.tryParse(value);
  return null;
}