stringToDouble function

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

Implementation

double? stringToDouble(String? value, [double? defaultValue]) {
  if (value == null) {
    return defaultValue;
  }

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