From 6405886acaf6f2cfc1b9a2cbd2cdd74cb9da3aef Mon Sep 17 00:00:00 2001 From: AmanRajSinghMourya Date: Mon, 30 Jun 2025 16:07:48 +0530 Subject: [PATCH] Hide Play original option when showing memories --- .../ui/viewer/file/video_widget_native.dart | 113 ++++++++++-------- 1 file changed, 61 insertions(+), 52 deletions(-) diff --git a/mobile/lib/ui/viewer/file/video_widget_native.dart b/mobile/lib/ui/viewer/file/video_widget_native.dart index 3ea44a797c..b3e6de3b54 100644 --- a/mobile/lib/ui/viewer/file/video_widget_native.dart +++ b/mobile/lib/ui/viewer/file/video_widget_native.dart @@ -372,64 +372,73 @@ class _VideoWidgetNativeState extends State ) : const SizedBox(); }, - valueListenable: _isPlaybackReady, + valueListenable: _isPlaybackReady, ), ), ), - Positioned( - bottom: verticalMargin, - right: 0, - left: 0, - child: SafeArea( - top: false, - left: false, - right: false, - child: Padding( - padding: EdgeInsets.only( - bottom: widget.isFromMemories ? 32 : 0, - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - _VideoDescriptionAndSwitchToMediaKitButton( - file: widget.file, - showControls: _showControls, - elTooltipController: _elTooltipController, - controller: _controller, - selectedPreview: widget.selectedPreview, - ), - ValueListenableBuilder( - valueListenable: _showControls, - builder: (context, value, _) { - return VideoStreamChangeWidget( - showControls: value, - file: widget.file, - isPreviewPlayer: widget.selectedPreview, - onStreamChange: widget.onStreamChange, - ); - }, - ), - ValueListenableBuilder( - valueListenable: _isPlaybackReady, - builder: - (BuildContext context, bool value, _) { - return value && !widget.isFromMemories - ? _SeekBarAndDuration( - controller: _controller, - duration: duration, - showControls: _showControls, - isSeeking: _isSeeking, - position: position, + widget.isFromMemories + ? const SizedBox.shrink() + : Positioned( + bottom: verticalMargin, + right: 0, + left: 0, + child: SafeArea( + top: false, + left: false, + right: false, + child: Padding( + padding: EdgeInsets.only( + bottom: widget.isFromMemories ? 32 : 0, + ), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + _VideoDescriptionAndSwitchToMediaKitButton( + file: widget.file, + showControls: _showControls, + elTooltipController: + _elTooltipController, + controller: _controller, + selectedPreview: widget.selectedPreview, + ), + ValueListenableBuilder( + valueListenable: _showControls, + builder: (context, value, _) { + return VideoStreamChangeWidget( + showControls: value, file: widget.file, - ) - : const SizedBox(); - }, + isPreviewPlayer: + widget.selectedPreview, + onStreamChange: + widget.onStreamChange, + ); + }, + ), + ValueListenableBuilder( + valueListenable: _isPlaybackReady, + builder: ( + BuildContext context, + bool value, + _, + ) { + return value + ? _SeekBarAndDuration( + controller: _controller, + duration: duration, + showControls: _showControls, + isSeeking: _isSeeking, + position: position, + file: widget.file, + ) + : const SizedBox(); + }, + ), + ], + ), ), - ], + ), ), - ), - ), - ), ], ), ),