getBool method

bool? getBool(
  1. String key, {
  2. bool? defaultValue,
})

Returns the stored bool, or defaultValue if not found.

Implementation

bool? getBool(String key, {bool? defaultValue}) {
  try {
    return _store.getBool(key) ?? defaultValue;
  } catch (e, st) {
    throw StorageException(
      message: 'Failed to get bool',
      key: key,
      cause: e,
      stackTrace: st,
    );
  }
}