setString static method

Future<bool> setString(
  1. String? key,
  2. String? value
)

Saves a string value to persistent storage in the background. Returns false if key is null.

Implementation

static Future<bool> setString(String? key, String? value) async {
  if (key == null || value == null) {
    return false;
  }
  final prefs = await instance;
  return prefs.setString(key, value);
}