tryReadInt method

int? tryReadInt(
  1. dynamic source,
  2. dynamic key
)

Tries to read an integer value from the source. If the value is not an integer, it returns null.

Implementation

int? tryReadInt(source, key) {
  var value = readValue(source, key);
  return isInt(value) ? value as int : null;
}