getBoolF static method

Future<bool> getBoolF(
  1. String? key, [
  2. bool? defValue
])

Returns a Future. Returns false if key is null.

Implementation

// ignore: avoid_positional_boolean_parameters
static Future<bool> getBoolF(String? key, [bool? defValue]) async {
  if (key == null) {
    return false;
  }
  bool value;
  if (_prefsInstance == null) {
    final prefs = await instance;
    value = prefs.getBool(key) ?? defValue ?? false;
  } else {
    // SharedPreferences is available. Ignore init() function.
    _initCalled = true;
    value = getBool(key, defValue);
  }
  return value;
}