getBool method
Returns the stored bool, or defaultValue if the key does not exist.
Implementation
Future<bool?> getBool(String key, {bool? defaultValue}) async {
try {
final raw = await _storage.read(key: key);
if (raw == null) return defaultValue;
return raw == 'true';
} catch (e, st) {
throw StorageException(
message: 'Failed to get bool',
key: key,
cause: e,
stackTrace: st,
);
}
}