toDoubleOrNull static method

double? toDoubleOrNull(
  1. dynamic value
)

Implementation

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