toDouble static method

double? toDouble(
  1. dynamic value
)

Implementation

static double? toDouble(value) {
  if (value is double) {
    return value;
  } else if (value is int) {
    return value.toDouble();
  } else if (value is String) {
    return double.tryParse(value);
  } else {
    return null;
  }
}