From b272c0fbf55098e07cb794163872973b620b578b Mon Sep 17 00:00:00 2001 From: Nikolas Rimikis Date: Tue, 29 Aug 2023 17:13:33 +0200 Subject: [PATCH] feat(neon): AppStorage skip initialization if already initialized Signed-off-by: Nikolas Rimikis --- packages/neon/neon/lib/src/settings/models/storage.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/neon/neon/lib/src/settings/models/storage.dart b/packages/neon/neon/lib/src/settings/models/storage.dart index 2169c182..349845ab 100644 --- a/packages/neon/neon/lib/src/settings/models/storage.dart +++ b/packages/neon/neon/lib/src/settings/models/storage.dart @@ -32,6 +32,10 @@ class AppStorage implements SettingsStorage { /// /// Required to be called before accessing [reqireDatabase]. static Future init() async { + if (_sharedPreferences != null) { + return; + } + _sharedPreferences = await SharedPreferences.getInstance(); }