Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Prev Previous commit
Next Next commit
Fix file version + linux logic for _cached
  • Loading branch information
gaetschwartz committed Feb 6, 2021
commit c4acbf3edbf3811ae97867694fa00b3fdb2cbecd
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class SharedPreferencesLinux extends SharedPreferencesStorePlatform {
return _cachedPreferences!;
}

_cachedPreferences = {};
var localDataFile = await _getLocalDataFile();
if (localDataFile.existsSync()) {
String stringMap = localDataFile.readAsStringSync();
Expand All @@ -50,6 +49,7 @@ class SharedPreferencesLinux extends SharedPreferencesStorePlatform {
}
}

_cachedPreferences ??= {};
return _cachedPreferences!;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ environment:
dependencies:
flutter:
sdk: flutter
file: ">=6.0.0-nullsafety.4 <7.0.0"
file: ^6.0.0-nullsafety.4
meta: ^1.0.4
path: ^1.8.0-nullsafety.3
path_provider_linux: ^0.2.0-nullsafety
Expand Down