preInit static method

Future<HiCache> preInit()

预初始化,防止在使用get时,prefs还未完成初始化

Implementation

static Future<HiCache> preInit() async {
  if (_instance == null) {
    var prefs = await SharedPreferences.getInstance();
    _instance = HiCache._pre(prefs);
  }
  return _instance!;
}