getString static method

String getString(
  1. String key, [
  2. String defaultValue = ''
])

Get a string value by key

Implementation

static String getString(String key, [String defaultValue = '']) {
  if (!_isInitialized || _prefs == null) return defaultValue;
  return _prefs!.getString(key) ?? defaultValue;
}