From 14749573d528601b258f3067bd5ef77d4812bdf4 Mon Sep 17 00:00:00 2001 From: Tom Xu Date: Sat, 28 Sep 2019 04:08:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=A4=E4=B8=AA=E5=9C=B0=E6=96=B9=E5=90=8C?= =?UTF-8?q?=E6=97=B6=E8=B0=83=E7=94=A8=E5=AF=BC=E8=87=B4=5Fspf=E4=B8=BAnul?= =?UTF-8?q?l=E8=80=8C=E5=8F=96=E4=B8=8D=E5=88=B0=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/utils/shared_preferences.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/utils/shared_preferences.dart b/lib/utils/shared_preferences.dart index 81f7dc70..c7351a66 100644 --- a/lib/utils/shared_preferences.dart +++ b/lib/utils/shared_preferences.dart @@ -24,8 +24,9 @@ class SpUtil { static Future 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(); } -} \ No newline at end of file +}