init static method

Future<SharedPreferences> init()

初始化 SharedPreferences 实例

必须在使用其他方法前调用一次进行初始化。

示例:

await SharepUtil.init();

Implementation

static Future<SharedPreferences> init() async {
  _prefs = await SharedPreferences.getInstance();
  return _prefs!;
}