getInt method

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

Reads a key value of int type from Map.

If value is NULL or not int type return default value defaultInt

Implementation

int getInt(String key, {int defaultValue = defaultInt}) {
  if (containsKey(key)) return toInt(this[key] ?? defaultValue);
  errorLogsNS("Map.getInt[$key] has incorrect data : ${this[key]}");
  return defaultValue;
}