stringToDouble function

double stringToDouble (
  1. String value,
  2. [double defaultValue]
)

Implementation

double stringToDouble(String value, [double defaultValue]) {
  if (value is! String) {
    return defaultValue;
  }

  return double.tryParse(value) ?? defaultValue;
}