readInt method

int readInt(
  1. dynamic source,
  2. dynamic key, {
  3. int defaultValue = -1,
})

Reads an integer value from the source, and if not found, returns the provided defaultValue.

Implementation

int readInt(source, key, {int defaultValue = -1}) {
  return tryReadInt(source, key) ?? defaultValue;
}