readNum method

num readNum(
  1. dynamic source,
  2. dynamic key, {
  3. num defaultValue = -1.0,
})

Reads a numeric value from the source, and if not found, returns the provided defaultValue.

Implementation

num readNum(source, key, {num defaultValue = -1.0}) {
  return tryReadNum(source, key) ?? defaultValue;
}