saveString static method

Future<bool> saveString(
  1. String key,
  2. String? value, [
  3. String defaultValue = ""
])

Implementation

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