fix(player): 评论输入弹窗改为紧凑高度

This commit is contained in:
Zhou Weidong committed 2026-10-21 13:36:52 +08:00
1 parent c8ac2c9823
commit e0024ed123
2 files changed
+55 -62

No files matched your search

+7 -3
View File
@@ -106,7 +106,8 @@ void main() {
final composer = find.byKey(const Key('comment-composer-sheet'));
expect(composer, findsOneWidget);
expect(tester.getSize(composer).height, closeTo(844 / 2, 0.1));
final compactHeight = tester.getSize(composer).height;
expect(compactHeight, inInclusiveRange(100, 150));
final input = find.byKey(const Key('comment-composer-input'));
expect(input, findsOneWidget);
expect(tester.widget<TextField>(input).focusNode?.hasFocus, isTrue);
@@ -117,6 +118,8 @@ void main() {
await tester.enterText(input, 'First line\nSecond line');
await tester.pump();
expect(tester.getSize(composer).height, greaterThan(compactHeight));
expect(tester.getSize(composer).height, lessThan(844 / 2));
final multilineField = tester.widget<TextField>(input);
expect(multilineField.textAlignVertical, TextAlignVertical.top);
expect(multilineField.style?.height, 1.4);
@@ -313,7 +316,8 @@ void main() {
final composer = find.byKey(const Key('comment-composer-sheet'));
final composerInput = find.byKey(const Key('comment-composer-input'));
expect(composer, findsOneWidget);
expect(tester.getSize(composer).height, closeTo(844 / 2, 0.1));
final compactHeight = tester.getSize(composer).height;
expect(compactHeight, inInclusiveRange(100, 150));
expect(tester.widget<TextField>(composerInput).focusNode?.hasFocus, isTrue);
final underlyingSheet = find.byKey(
const Key('player-comments-sheet'),
@@ -333,7 +337,7 @@ void main() {
tester.view.viewInsets = const FakeViewPadding(bottom: 180);
await tester.pump();
await tester.pump(const Duration(milliseconds: 200));
expect(tester.getSize(composer).height, closeTo(844 / 2, 0.1));
expect(tester.getSize(composer).height, closeTo(compactHeight, 0.1));
expect(tester.getBottomLeft(composer).dy, closeTo(844 - 180, 0.1));
expect(
tester.getBottomLeft(composerInput).dy,