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
@@ -214,8 +214,11 @@ class ChatBackgroundSettingsPage extends StatelessWidget {
final file = File(AppPaths.chatBackgroundImage);
await file.writeAsBytes(bytes);
// Same filename across replacements → the decoded image is cached under
// an identical key. Evict so the new bytes actually show.
await FileImage(file).evict();
// an identical key (for "cover" also wrapped in a viewport-sized
// ResizeImage). Clearing the cache is fine for this rare action.
PaintingBinding.instance.imageCache
..clear()
..clearLiveImages();
final cs = settings.val(write: true).chatBackgroundSettings;
cs.imageVersion++;
cs.type = ChatBackgroundType.image;