fix(player): 键盘弹出不压缩视频页

This commit is contained in:
Zhou Weidong committed 2026-10-21 12:47:52 +08:00
1 parent 33b49c161a
commit 1776c622ae
4 files changed
+44

No files matched your search

+20
View File
@@ -86,6 +86,26 @@ void main() {
expect(tester.widget<PlayerPage>(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<Scaffold>(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);
+22
View File
@@ -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<Scaffold>(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 {