From d849834ce661e0b2ef96490fb69afe4a980d90e8 Mon Sep 17 00:00:00 2001 From: Zhou Weidong <502333560@qq.com> Date: Tue, 20 Oct 2026 11:35:48 +0800 Subject: [PATCH] =?UTF-8?q?fix(flutter):=20=E6=B8=85=E5=B1=8F=E6=97=B6?= =?UTF-8?q?=E4=BF=9D=E7=95=99=E8=BF=9B=E5=BA=A6=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/player/widgets/player_overlay.dart | 34 +++++++++++++------- test/player/player_fullscreen_test.dart | 4 +++ 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/lib/pages/player/widgets/player_overlay.dart b/lib/pages/player/widgets/player_overlay.dart index ae72e42..c5054cc 100644 --- a/lib/pages/player/widgets/player_overlay.dart +++ b/lib/pages/player/widgets/player_overlay.dart @@ -146,7 +146,11 @@ class PlayerPlaybackOverlay extends StatelessWidget { bottom: 0, child: Column( mainAxisSize: MainAxisSize.min, - children: [if (controlsVisible) _bottomInfo(context), _bottomActions()], + children: [ + if (controlsVisible) _bottomInfo(context), + _bottomProgress(), + _bottomActions(), + ], ), ); } @@ -171,22 +175,28 @@ class PlayerPlaybackOverlay extends StatelessWidget { authorNote: data.authorNote, textScale: data.textScale, ), - const SizedBox(height: 2), - SeekProgressBar( - key: const Key('player-progress'), - valueListenable: data.controller, - semanticsLabel: data.l10n.seekVideo, - showTimes: true, - compact: true, - inactiveTrackColor: Colors.white24, - onScrubStart: actions.onScrubStart, - onSeek: actions.onSeek, - ), ], ), ); } + Widget _bottomProgress() { + return Padding( + key: const Key('player-progress-container'), + padding: EdgeInsets.fromLTRB(14, controlsVisible ? 2 : 8, 14, 0), + child: SeekProgressBar( + key: const Key('player-progress'), + valueListenable: data.controller, + semanticsLabel: data.l10n.seekVideo, + showTimes: true, + compact: true, + inactiveTrackColor: Colors.white24, + onScrubStart: actions.onScrubStart, + onSeek: actions.onSeek, + ), + ); + } + Widget _detailRow(String series) { return Material( color: Colors.transparent, diff --git a/test/player/player_fullscreen_test.dart b/test/player/player_fullscreen_test.dart index 6f24abd..07ea8f4 100644 --- a/test/player/player_fullscreen_test.dart +++ b/test/player/player_fullscreen_test.dart @@ -113,6 +113,7 @@ void main() { expect(find.byKey(const Key('player-controls-top')), findsOneWidget); expect(find.byKey(const Key('player-controls-bottom')), findsNothing); expect(find.byKey(const Key('player-bottom-actions')), findsOneWidget); + expect(find.byKey(const Key('player-progress')), findsOneWidget); expect(find.byKey(const Key('player-interaction-rail')), findsNothing); expect(find.byType(PlayerCenterToggle), findsOneWidget); expect( @@ -246,6 +247,7 @@ void main() { expect(find.byKey(const Key('player-controls-top')), findsOneWidget); expect(find.byKey(const Key('player-controls-bottom')), findsNothing); expect(find.byKey(const Key('player-bottom-actions')), findsOneWidget); + expect(find.byKey(const Key('player-progress')), findsOneWidget); expect(find.byKey(const Key('player-interaction-rail')), findsNothing); expect(find.byKey(const Key('player-bottom-clear-screen')), findsOneWidget); @@ -440,6 +442,7 @@ void main() { expect(find.byKey(const Key('player-controls-top')), findsOneWidget); expect(find.byKey(const Key('player-controls-bottom')), findsNothing); expect(find.byKey(const Key('player-bottom-actions')), findsOneWidget); + expect(find.byKey(const Key('player-progress')), findsOneWidget); expect(find.byKey(const Key('player-interaction-rail')), findsNothing); expect(find.byTooltip('Exit clear screen'), findsOneWidget); }); @@ -456,6 +459,7 @@ void main() { expect(find.byKey(const Key('player-controls-top')), findsOneWidget); expect(find.byKey(const Key('player-controls-bottom')), findsNothing); expect(find.byKey(const Key('player-bottom-actions')), findsOneWidget); + expect(find.byKey(const Key('player-progress')), findsOneWidget); expect(find.byKey(const Key('player-interaction-rail')), findsNothing); expect(find.byType(PlayerCenterToggle), findsNothing); expect(find.byTooltip('Exit clear screen'), findsOneWidget);