getBool method

bool getBool(
  1. String key,
  2. bool defaultValue
)

--- STORAGE HELPERS (GETTERS) --- Reads a boolean from SharedPreferences. Returns defaultValue if the key is missing.

Implementation

/// Reads a boolean from `SharedPreferences`.
/// Returns [defaultValue] if the key is missing.
bool getBool(String key, bool defaultValue) =>
    _prefs.getBool(key) ?? defaultValue;