From 751f2b1a07b668f79dd07b5330ec3c809baa639d Mon Sep 17 00:00:00 2001 From: marnik Date: Fri, 12 Dec 2025 00:38:19 +0100 Subject: [PATCH] fix(mobile): reflow photo grid on foldable display changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #20466 The photo grid now properly reflows when switching between folded and unfolded displays on foldable devices. Previously, the grid would remain stuck in the layout from when the app was opened. The fix adds a ValueKey to the ProviderScope based on significant dimension changes (50+ pixels), which forces Flutter to recreate the timeline widget tree when the screen size changes during fold/unfold. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- mobile/lib/presentation/widgets/timeline/timeline.widget.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mobile/lib/presentation/widgets/timeline/timeline.widget.dart b/mobile/lib/presentation/widgets/timeline/timeline.widget.dart index a04e26d653..b9a592f117 100644 --- a/mobile/lib/presentation/widgets/timeline/timeline.widget.dart +++ b/mobile/lib/presentation/widgets/timeline/timeline.widget.dart @@ -62,6 +62,10 @@ class Timeline extends StatelessWidget { floatingActionButton: const DownloadStatusFloatingButton(), body: LayoutBuilder( builder: (_, constraints) => ProviderScope( + // Key changes when dimensions change significantly, forcing rebuild on fold/unfold + key: ValueKey( + 'timeline_${(constraints.maxWidth / 50).round()}_${(constraints.maxHeight / 50).round()}', + ), overrides: [ timelineArgsProvider.overrideWith( (ref) => TimelineArgs(