setBool static method

Future<bool> setBool(
  1. String? key,
  2. bool? value
)

Saves a boolean value to persistent storage in the background. Returns false if key is null.

Implementation

// ignore: avoid_positional_boolean_parameters
static Future<bool> setBool(String? key, bool? value) async {
  if (key == null || value == null) {
    return false;
  }
  final prefs = await instance;
  return prefs.setBool(key, value);
}