improved performance and battery usage on older devices

This commit is contained in:
2026-09-25 23:58:08 +02:00
parent ed8e52f475
commit 56a497985b
70 changed files with 1631 additions and 621 deletions
+21
View File
@@ -0,0 +1,21 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:marianum_mobile/api/cache_store.dart';
void main() {
group('CacheStore.parse', () {
test('splits the timestamp header from the payload', () {
final entry = CacheStore.parse('1700000000000\n{"a":"b\\nc"}');
expect(entry!.lastUpdate, 1700000000000);
expect(entry.json, '{"a":"b\\nc"}');
});
test('keeps newlines inside the payload', () {
expect(CacheStore.parse('1\nline1\nline2')!.json, 'line1\nline2');
});
test('rejects files without a valid header', () {
expect(CacheStore.parse('{"a":1}'), isNull);
expect(CacheStore.parse('abc\n{}'), isNull);
});
});
}