setBool method

Future<void> setBool(
  1. String key, {
  2. required bool value,
})

Encrypts and saves a bool value (stored as "true" / "false").

Implementation

Future<void> setBool(String key, {required bool value}) async {
  try {
    await _storage.write(key: key, value: value.toString());
  } catch (e, st) {
    throw StorageException(
      message: 'Failed to set bool',
      key: key,
      cause: e,
      stackTrace: st,
    );
  }
}