From 776b9cbad5115760f04fc82edca19bde65d6be9d Mon Sep 17 00:00:00 2001 From: Thomas <9749173+uhthomas@users.noreply.github.com> Date: Sun, 5 Apr 2026 03:54:34 +0100 Subject: [PATCH] fix(mobile): use key on video controls (#27512) The widget is not recreated correctly when videoPlayName changes, which can cause weird behaviour with hooks and timers (like timers not firing when they should do). Using a key forces flutter to recreate the widget properly and allow the assumptions in build to work correctly. --- .../presentation/widgets/asset_viewer/bottom_bar.widget.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mobile/lib/presentation/widgets/asset_viewer/bottom_bar.widget.dart b/mobile/lib/presentation/widgets/asset_viewer/bottom_bar.widget.dart index b51960bb05..1f327bf79f 100644 --- a/mobile/lib/presentation/widgets/asset_viewer/bottom_bar.widget.dart +++ b/mobile/lib/presentation/widgets/asset_viewer/bottom_bar.widget.dart @@ -74,7 +74,7 @@ class ViewerBottomBar extends ConsumerWidget { child: Column( mainAxisSize: MainAxisSize.min, children: [ - if (asset.isVideo) VideoControls(videoPlayerName: asset.heroTag), + if (asset.isVideo) VideoControls(key: ValueKey(asset.heroTag), videoPlayerName: asset.heroTag), if (!isReadonlyModeEnabled) Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: actions), ],