toDouble method

double toDouble({
  1. double defaultValue = 0.0,
})

Return double value of given string

Implementation

double toDouble({double defaultValue = 0.0}) {
  if (this == null) return defaultValue;

  try {
    return double.parse(this!);
  } catch (e) {
    return defaultValue;
  }
}