getInt method

int getInt(
  1. String key, {
  2. int defaultValue = 0,
})

Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key.

@param key a String @param defaultValue Value to return if key does not exist @return an int value

Implementation

int getInt(String key, {int defaultValue = 0}) {
  // unparcel();
  var o = _map[key];
  if (o == null) {
    return defaultValue;
  }
  try {
    return o as int;
  } catch (e) {
    // typeWarning(key, o, "Integer", defaultValue, e);
    return defaultValue;
  }
}