setBool static method

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

存储布尔值到 SharedPreferences

示例:

await SharepUtil.setBool('isFirstOpen', true);

Implementation

static Future<void> setBool(String key, bool value) async {
  final prefs = _prefs ?? await init();
  await prefs.setBool(key, value);
}