From 6dbeb3e505486b2f035c3c3500b949efda71ffd9 Mon Sep 17 00:00:00 2001 From: Zhou Weidong <502333560@qq.com> Date: Tue, 20 Oct 2026 11:03:53 +0800 Subject: [PATCH] =?UTF-8?q?fix(flutter):=20=E6=94=AF=E6=8C=81=E5=85=A8?= =?UTF-8?q?=E5=B1=8F=E8=83=B6=E5=9B=8A=E5=8F=8C=E6=80=81=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/player/widgets/player_overlay.dart | 8 +++++--- test/player/player_fullscreen_test.dart | 13 +++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/lib/pages/player/widgets/player_overlay.dart b/lib/pages/player/widgets/player_overlay.dart index ade1564..ab3de69 100644 --- a/lib/pages/player/widgets/player_overlay.dart +++ b/lib/pages/player/widgets/player_overlay.dart @@ -56,8 +56,8 @@ class PlayerPlaybackOverlay extends StatelessWidget { _top(context), _bottom(context), _rail(context), - _fullScreenPill(), ], + _fullScreenPill(), if (!controlsVisible) Positioned( top: AppDimens.spaceSm, @@ -321,7 +321,7 @@ class PlayerPlaybackOverlay extends StatelessWidget { child: InkWell( key: const Key('player-fullscreen-toggle'), borderRadius: BorderRadius.circular(999), - onTap: actions.onClear, + onTap: controlsVisible ? actions.onClear : actions.onExitClear, child: Padding( padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 7), child: Row( @@ -334,7 +334,9 @@ class PlayerPlaybackOverlay extends StatelessWidget { ), const SizedBox(width: 5), Text( - data.l10n.fullScreenWatch, + controlsVisible + ? data.l10n.fullScreenWatch + : data.l10n.exitClearScreen, style: const TextStyle( color: AppColors.onPrimary, fontSize: 12, diff --git a/test/player/player_fullscreen_test.dart b/test/player/player_fullscreen_test.dart index 8c5dd9d..bc3108d 100644 --- a/test/player/player_fullscreen_test.dart +++ b/test/player/player_fullscreen_test.dart @@ -383,6 +383,19 @@ void main() { expect(find.byKey(const Key('player-exit-clear-screen')), findsOneWidget); }); + testWidgets('should_toggle_fullscreen_from_the_same_pill', (tester) async { + await _pumpApp(tester); + await _openSeriesPlayer(tester); + await tester.tap(find.byKey(const Key('player-fullscreen-toggle'))); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('player-controls-top')), findsNothing); + + await tester.tap(find.byKey(const Key('player-fullscreen-toggle'))); + await tester.pumpAndSettle(); + expect(find.byKey(const Key('player-controls-top')), findsOneWidget); + expect(find.byKey(const Key('player-controls-bottom')), findsOneWidget); + }); + testWidgets('should_open_unlock_panel_with_honest_method_states', ( tester, ) async {