merge: 合并 K86.18 输入浮层实底填充修正
This commit is contained in:
commit
2ae4aedac0
2 files changed
+20
-12
No files matched your search
@@ -137,22 +137,23 @@ class _CommentComposerSheetState extends State<CommentComposerSheet> {
|
||||
Positioned(
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: _pinnedKeyboardInset,
|
||||
bottom: 0,
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () {},
|
||||
child: SizedBox(
|
||||
key: const Key('comment-composer-sheet'),
|
||||
width: double.infinity,
|
||||
child: Material(
|
||||
color: AppColors.card,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
borderRadius: const BorderRadius.vertical(
|
||||
top: Radius.circular(_sheetRadius),
|
||||
),
|
||||
child: SafeArea(
|
||||
top: false,
|
||||
child: Material(
|
||||
key: const Key('comment-composer-panel'),
|
||||
color: AppColors.card,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
borderRadius: const BorderRadius.vertical(
|
||||
top: Radius.circular(_sheetRadius),
|
||||
),
|
||||
child: SafeArea(
|
||||
top: false,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(bottom: _pinnedKeyboardInset),
|
||||
child: Padding(
|
||||
key: const Key('comment-composer-sheet'),
|
||||
padding: const EdgeInsets.fromLTRB(16, 12, 16, 12),
|
||||
child: TextFieldTapRegion(
|
||||
child: Column(
|
||||
|
||||
@@ -350,8 +350,10 @@ void main() {
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final composer = find.byKey(const Key('comment-composer-sheet'));
|
||||
final composerPanel = find.byKey(const Key('comment-composer-panel'));
|
||||
final composerInput = find.byKey(const Key('comment-composer-input'));
|
||||
expect(composer, findsOneWidget);
|
||||
expect(composerPanel, findsOneWidget);
|
||||
final overlayRoot = find.byKey(const Key('comment-composer-overlay'));
|
||||
expect(overlayRoot, findsOneWidget);
|
||||
final overlayStack = tester.widget<Stack>(overlayRoot);
|
||||
@@ -386,8 +388,10 @@ void main() {
|
||||
await tester.pump();
|
||||
await tester.pump(const Duration(milliseconds: 200));
|
||||
final keyboardUpBottom = tester.getBottomLeft(composer).dy;
|
||||
final keyboardUpPanelRect = tester.getRect(composerPanel);
|
||||
expect(tester.getSize(composer).height, closeTo(compactHeight, 0.1));
|
||||
expect(keyboardUpBottom, closeTo(844 - 180, 0.1));
|
||||
expect(keyboardUpPanelRect.bottom, closeTo(844, 0.1));
|
||||
expect(
|
||||
tester.getBottomLeft(composerInput).dy,
|
||||
lessThanOrEqualTo(844 - 180),
|
||||
@@ -398,6 +402,9 @@ void main() {
|
||||
await tester.pumpAndSettle();
|
||||
expect(composer, findsOneWidget);
|
||||
expect(tester.getBottomLeft(composer).dy, closeTo(keyboardUpBottom, 0.1));
|
||||
expect(tester.getRect(composerPanel), keyboardUpPanelRect);
|
||||
expect(tester.widget<Material>(composerPanel).color, AppColors.card);
|
||||
expect(tester.getBottomLeft(composerPanel).dy, closeTo(844, 0.1));
|
||||
expect(commentsSheet, findsOneWidget);
|
||||
expect(list, findsOneWidget);
|
||||
expect(placeholder, findsOneWidget);
|
||||
|
||||
Reference in new issue
Block a user