Skip to content

Commit e09cfe7

Browse files
committed
Fix deprecated local storage invocations
1 parent e536157 commit e09cfe7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drift/lib/src/web/storage.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ class _LocalStorageImpl implements DriftWebStorage, CustomSchemaVersionSave {
121121

122122
@override
123123
int? get schemaVersion {
124-
final versionStr = _localStorage[_versionKey];
125-
// ignore: avoid_returning_null
124+
final versionStr = _localStorage.getItem(_versionKey);
126125
if (versionStr == null) return null;
127126

128127
return int.tryParse(versionStr);
@@ -153,7 +152,7 @@ class _LocalStorageImpl implements DriftWebStorage, CustomSchemaVersionSave {
153152
@override
154153
Future<void> store(Uint8List data) {
155154
final binStr = bin2str.encode(data);
156-
_localStorage[_persistenceKey] = binStr;
155+
_localStorage.setItem(_persistenceKey, binStr);
157156

158157
return Future.value();
159158
}

0 commit comments

Comments
 (0)