mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
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.
This commit is contained in:
@@ -74,7 +74,7 @@ class ViewerBottomBar extends ConsumerWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
if (asset.isVideo) VideoControls(videoPlayerName: asset.heroTag),
|
if (asset.isVideo) VideoControls(key: ValueKey(asset.heroTag), videoPlayerName: asset.heroTag),
|
||||||
if (!isReadonlyModeEnabled)
|
if (!isReadonlyModeEnabled)
|
||||||
Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: actions),
|
Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: actions),
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user