Merge pull request #380 from hengkx/master

SharedPreferences 两个地方同时调用导致_spf为null而取不到值
This commit is contained in:
hanxu317317
2019-10-07 15:08:13 +08:00
committed by GitHub

View File

@ -24,8 +24,9 @@ class SpUtil {
static Future<SpUtil> getInstance() async {
if (_instance == null) {
_instance = new SpUtil._();
}
if (_spf == null) {
await _instance._init();
}
return _instance;
}
@ -117,4 +118,4 @@ class SpUtil {
if (_beforeCheck()) return null;
return _spf.clear();
}
}
}