From 1776c622ae9f7999820c3685144df0a902af65fc Mon Sep 17 00:00:00 2001 From: Zhou Weidong <502333560@qq.com> Date: Wed, 21 Oct 2026 12:47:52 +0800 Subject: [PATCH] =?UTF-8?q?fix(player):=20=E9=94=AE=E7=9B=98=E5=BC=B9?= =?UTF-8?q?=E5=87=BA=E4=B8=8D=E5=8E=8B=E7=BC=A9=E8=A7=86=E9=A2=91=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/home/home_view.dart | 1 + lib/pages/player/player_view.dart | 1 + test/home/k28_a_navigation_test.dart | 20 ++++++++++++++++++++ test/player/player_fullscreen_test.dart | 22 ++++++++++++++++++++++ 4 files changed, 44 insertions(+) diff --git a/lib/pages/home/home_view.dart b/lib/pages/home/home_view.dart index a30acc7..61c2e62 100644 --- a/lib/pages/home/home_view.dart +++ b/lib/pages/home/home_view.dart @@ -247,6 +247,7 @@ class _HomeTabsState extends State<_HomeTabs> { child: Scaffold( key: logic.scaffoldKey, backgroundColor: Colors.transparent, + resizeToAvoidBottomInset: false, body: _body(context), bottomNavigationBar: logic.videoImmersive ? null : _nav(context, l10n), ), diff --git a/lib/pages/player/player_view.dart b/lib/pages/player/player_view.dart index 91d05cb..b17ea9f 100644 --- a/lib/pages/player/player_view.dart +++ b/lib/pages/player/player_view.dart @@ -291,6 +291,7 @@ class _PlayerPageState extends State : Scaffold( key: const Key('player-scaffold'), backgroundColor: Colors.transparent, + resizeToAvoidBottomInset: false, body: body, ), ), diff --git a/test/home/k28_a_navigation_test.dart b/test/home/k28_a_navigation_test.dart index 880bbeb..df83f11 100644 --- a/test/home/k28_a_navigation_test.dart +++ b/test/home/k28_a_navigation_test.dart @@ -86,6 +86,26 @@ void main() { expect(tester.widget(find.byType(PlayerPage)).homeMode, isTrue); }); + testWidgets('should_keep_home_feed_size_when_keyboard_insets_change', ( + tester, + ) async { + addTearDown(tester.view.resetViewInsets); + await _pumpApp(tester); + final feed = find.byKey(const Key('home-feed-black-background')); + final before = tester.getRect(feed); + + tester.view.viewInsets = const FakeViewPadding(bottom: 300); + await tester.pump(); + + expect( + tester + .widget(find.byType(Scaffold).first) + .resizeToAvoidBottomInset, + isFalse, + ); + expect(tester.getRect(feed), before); + }); + testWidgets('should_open_full_player_from_full_series_bar', (tester) async { await _pumpApp(tester); diff --git a/test/player/player_fullscreen_test.dart b/test/player/player_fullscreen_test.dart index 9ee28af..9c36348 100644 --- a/test/player/player_fullscreen_test.dart +++ b/test/player/player_fullscreen_test.dart @@ -555,6 +555,28 @@ void main() { expect(tester.takeException(), isNull); }); + testWidgets( + 'should_keep_fullscreen_player_position_when_keyboard_insets_change', + (tester) async { + addTearDown(tester.view.resetViewInsets); + await _pumpApp(tester); + await _openSeriesPlayer(tester); + final rail = find.byKey(const Key('player-interaction-rail')); + final before = tester.getRect(rail); + + tester.view.viewInsets = const FakeViewPadding(bottom: 300); + await tester.pump(); + + expect( + tester + .widget(find.byKey(const Key('player-scaffold'))) + .resizeToAvoidBottomInset, + isFalse, + ); + expect(tester.getRect(rail), before); + }, + ); + testWidgets('should_keep_series_clear_state_when_swiping_next_episode', ( tester, ) async {