diff --git a/lib/pages/player/widgets/comment_composer_sheet.dart b/lib/pages/player/widgets/comment_composer_sheet.dart index a302c45..1ccfd0e 100644 --- a/lib/pages/player/widgets/comment_composer_sheet.dart +++ b/lib/pages/player/widgets/comment_composer_sheet.dart @@ -137,22 +137,23 @@ class _CommentComposerSheetState extends State { 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( diff --git a/test/comment/drama_comments_sheet_test.dart b/test/comment/drama_comments_sheet_test.dart index cd0c676..e7ec953 100644 --- a/test/comment/drama_comments_sheet_test.dart +++ b/test/comment/drama_comments_sheet_test.dart @@ -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(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(composerPanel).color, AppColors.card); + expect(tester.getBottomLeft(composerPanel).dy, closeTo(844, 0.1)); expect(commentsSheet, findsOneWidget); expect(list, findsOneWidget); expect(placeholder, findsOneWidget);