basicTypeToDouble function

double? basicTypeToDouble(
  1. Object? value
)

parse any double or parse as int

Implementation

double? basicTypeToDouble(Object? value) {
  /// But most likely to happen first
  if (value is double) {
    return value;
  } else if (value == null) {
    return null;
  } else if (value is int) {
    return value.toDouble();
  } else if (value is bool) {
    return value ? 1.0 : 0.0;
  } else if (value is String) {
    return _parseDouble(value);
  } else {
    return _parseDouble(value.toString());
  }
}