getInt static method

int getInt(
  1. String key, {
  2. int? def,
})

Implementation

static int getInt(String key, {int? def}) {
  int val = 0;
  if (_memoryPrefs.containsKey(key)) {
    val = _memoryPrefs[key];
  }
  if (val == null) {
    val = _prefs!.getInt(key)!;
  }
  if (val == null) {
    val = def!;
  }
  _memoryPrefs[key] = val;
  return val;
}