fix(mobile): reflow photo grid on foldable display changes

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 <noreply@anthropic.com>
pull/24529/head
marnik 2025-12-12 00:38:19 +01:00
parent 4b345e02ff
commit 751f2b1a07
1 changed files with 4 additions and 0 deletions

View File

@ -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(