optDouble method

double optDouble(
  1. String name, {
  2. double fallback = double.nan,
})

Returns the value mapped by {@code name} if it exists and is a double or can be coerced to a double, or {@code fallback} otherwise.

Implementation

double optDouble(String name, {double fallback = double.nan}) {
  dynamic object = opt(name);
  return _toDouble(object) ?? fallback;
}