From 46ba32dae6d5f1809fb066ed008931080272e4c4 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 20 Jul 2026 04:52:55 +0000 Subject: [PATCH 1/2] Fix CI: use ClipRect instead of unsupported Column.clipBehavior Column (a Flex) does not accept a clipBehavior parameter, so flutter analyze failed with undefined_named_parameter. Wrap the inner Column in a ClipRect to clip overflowing children when a parent constrains the picker tighter than its natural height (#256). Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01FR5kaTA7MWRLWGmTvcN8BG --- .../emoji_view/default_emoji_picker_view.dart | 43 ++++++++++--------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/lib/src/emoji_view/default_emoji_picker_view.dart b/lib/src/emoji_view/default_emoji_picker_view.dart index cf5d538..65ee0e8 100644 --- a/lib/src/emoji_view/default_emoji_picker_view.dart +++ b/lib/src/emoji_view/default_emoji_picker_view.dart @@ -83,26 +83,29 @@ class _DefaultEmojiPickerViewState extends State return EmojiContainer( color: widget.config.emojiViewConfig.backgroundColor, buttonMode: widget.config.emojiViewConfig.buttonMode, - child: Column( - children: [ - widget.config.viewOrderConfig.top, - widget.config.viewOrderConfig.middle, - widget.config.viewOrderConfig.bottom, - ].map( - (item) { - switch (item) { - case EmojiPickerItem.categoryBar: - // Category view - return _buildCategoryView(); - case EmojiPickerItem.emojiView: - // Emoji view - return _buildEmojiView(emojiSize, emojiBoxSize); - case EmojiPickerItem.searchBar: - // Search Bar - return _buildBottomSearchBar(); - } - }, - ).toList(), + // Clip overflow when constrained tighter than natural height (#256). + child: ClipRect( + child: Column( + children: [ + widget.config.viewOrderConfig.top, + widget.config.viewOrderConfig.middle, + widget.config.viewOrderConfig.bottom, + ].map( + (item) { + switch (item) { + case EmojiPickerItem.categoryBar: + // Category view + return _buildCategoryView(); + case EmojiPickerItem.emojiView: + // Emoji view + return _buildEmojiView(emojiSize, emojiBoxSize); + case EmojiPickerItem.searchBar: + // Search Bar + return _buildBottomSearchBar(); + } + }, + ).toList(), + ), ), ); }, From e8c8c469fbdb2ff36f70b2ec9ee592c6efe6fdaf Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 20 Jul 2026 05:18:13 +0000 Subject: [PATCH 2/2] Add widget test for overflow clipping in DefaultEmojiPickerView Verifies the inner Column is wrapped in a ClipRect so overflow is clipped when the picker is constrained tighter than its natural height (#256). Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01FR5kaTA7MWRLWGmTvcN8BG --- test/emoji_picker_test.dart | 47 +++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/test/emoji_picker_test.dart b/test/emoji_picker_test.dart index ff1eb4d..e7ae985 100644 --- a/test/emoji_picker_test.dart +++ b/test/emoji_picker_test.dart @@ -146,5 +146,52 @@ void main() { // Check if the category been passed to the 'onEmojiSelected' callback expect(_categorySelected, equals(Category.SMILEYS)); }); + + testWidgets('Clips overflow when constrained tighter than natural height', + (WidgetTester tester) async { + final _controller = TextEditingController(); + + // Constrain the picker far below the natural sum of the category bar + // and bottom action bar to force the inner Column to overflow (#256). + await tester.pumpWidget( + MaterialApp( + home: Scaffold( + body: Center( + child: SizedBox( + width: 300, + height: 30, + child: EmojiPicker( + textEditingController: _controller, + config: const Config( + height: 30, + categoryViewConfig: CategoryViewConfig( + recentTabBehavior: RecentTabBehavior.NONE, + ), + ), + ), + ), + ), + ), + ), + ); + await tester.pump(); + + // A RenderFlex overflow is reported in debug mode; drain it so the test + // can assert the overflow is clipped rather than left painting stripes. + final exception = tester.takeException(); + expect( + exception == null || exception.toString().contains('overflowed'), + isTrue, + ); + + // The inner Column is wrapped in a ClipRect that clips the overflow. + expect( + find.descendant( + of: find.byType(EmojiContainer), + matching: find.byType(ClipRect), + ), + findsOneWidget, + ); + }); }); }