getBool method

Future<bool?> getBool(
  1. String key
)

获取保存bool

Implementation

Future<bool?> getBool(String key) async {
  // obtain shared preferences
  final prefs = await SharedPreferences.getInstance();
  var value = prefs.getBool(key);
  return Future.value(value);
}