mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Make sure that a TextSelectionToolbarTextButton doesn't crash in 0x0 … (#178374)
This is my attempt to handle https://github.com/flutter/flutter/issues/6537 for the TextSelectionToolbarTextButton widget. Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com> Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
This commit is contained in:
parent
63ef482845
commit
c5d2104166
@ -176,4 +176,19 @@ void main() {
|
||||
expect(textButton.style!.backgroundColor!.resolve(<WidgetState>{}), 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);
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user