Browse Source

feat(neon): AppStorage skip initialization if already initialized

Signed-off-by: Nikolas Rimikis <rimikis.nikolas@gmail.com>
pull/674/head
Nikolas Rimikis 1 year ago
parent
commit
b272c0fbf5
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  1. 4
      packages/neon/neon/lib/src/settings/models/storage.dart

4
packages/neon/neon/lib/src/settings/models/storage.dart

@ -32,6 +32,10 @@ class AppStorage implements SettingsStorage {
/// ///
/// Required to be called before accessing [reqireDatabase]. /// Required to be called before accessing [reqireDatabase].
static Future init() async { static Future init() async {
if (_sharedPreferences != null) {
return;
}
_sharedPreferences = await SharedPreferences.getInstance(); _sharedPreferences = await SharedPreferences.getInstance();
} }

Loading…
Cancel
Save