writeBool method

Future<void> writeBool(
  1. String key,
  2. bool value
)

Writes a boolean value to the store under the given key.

Implementation

Future<void> writeBool(String key, bool value) async {
  if (useSecure) {
    await _secureStorage.write(key: key, value: value.toString());
  } else {
    final prefs = await SharedPreferences.getInstance();
    await prefs.setBool(key, value);
  }
}