toDouble static method

double toDouble(
  1. Object? value
)

toDouble assumes that the input is numeric or it is a string that has a numeric format and tries to convert it to a double value

Implementation

static double toDouble(Object? value) {
  if (value is double) {
    return value;
  } else if (value is String) {
    return value.toString().toDoubleAmount();
  }
  return 0.0;
}