improved performance and battery usage on older devices
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user