diff --git a/packages/flutter/test/material/text_selection_toolbar_text_button_test.dart b/packages/flutter/test/material/text_selection_toolbar_text_button_test.dart index ef321760f1f..fe8ee633284 100644 --- a/packages/flutter/test/material/text_selection_toolbar_text_button_test.dart +++ b/packages/flutter/test/material/text_selection_toolbar_text_button_test.dart @@ -176,4 +176,19 @@ void main() { expect(textButton.style!.backgroundColor!.resolve({}), Colors.transparent); }); } + + testWidgets('TextSelectionToolbarTextButton does not crash at zero area', ( + WidgetTester tester, + ) async { + await tester.pumpWidget( + const MaterialApp( + home: Center( + child: SizedBox.shrink( + child: TextSelectionToolbarTextButton(padding: EdgeInsets.all(5), child: Text('X')), + ), + ), + ), + ); + expect(tester.getSize(find.byType(TextSelectionToolbarTextButton)), Size.zero); + }); }