mapInt static method

int? mapInt(
  1. Map? map,
  2. dynamic key, {
  3. int? defaultValue,
})

Returns the value from mapVal as an int if it is numeric

Implementation

static int? mapInt(Map? map, dynamic key, {int? defaultValue}) {
  dynamic value = mapVal(map, key, defaultValue: defaultValue);
  if (isNumber(value)) {
    value = S.toInt(value);
  } else {
    value = defaultValue;
  }
  return value;
}