getString static method

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

Implementation

static String getString(String key, {String? def}) {
  String val = '';
  if (_memoryPrefs.containsKey(key)) {
    val = _memoryPrefs[key];
  }
  if (val.isEmpty) {
    val = _prefs?.getString(key) ?? '';
  }
  if (val == null) {
    val = def!;
  }
  _memoryPrefs[key] = val;
  return val;
}