readString static method

Future<String> readString(
  1. String key, [
  2. String defaultValue = ""
])

Implementation

static Future<String> readString(String key,
    [String defaultValue = ""]) async {
  final prefs = await SharedPreferences.getInstance();
  return prefs.getString(key) ?? defaultValue;
}