feat: add package source compatibility controls

This commit is contained in:
gem
2026-06-10 17:54:12 +08:00
parent 6608d0a975
commit 79ee35db2f
12 changed files with 611 additions and 30 deletions

View File

@@ -25,10 +25,7 @@ class RuntimeStorageManager {
try {
final raw = jsonDecode(file.readAsStringSync());
if (raw is Map) {
return RuntimeStorageManager._(
file,
Map<String, Object?>.from(raw),
);
return RuntimeStorageManager._(file, Map<String, Object?>.from(raw));
}
} catch (_) {
// Corrupt storage should not prevent a game from loading.
@@ -78,7 +75,8 @@ class RuntimeStorageManager {
}
if (value is Map) {
return {
for (final entry in value.entries) entry.key.toString(): _normalize(entry.value),
for (final entry in value.entries)
entry.key.toString(): _normalize(entry.value),
};
}
return value.toString();