mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Make sure that a TextButton doesn't crash in 0x0 environment (#178213)
This is my attempt to handle https://github.com/flutter/flutter/issues/6537 for the TextButton widget.
This commit is contained in:
parent
ab919febb3
commit
b705072f08
@ -2680,4 +2680,17 @@ void main() {
|
||||
// The button should still be focused.
|
||||
expect(getButtonFocusNode().hasFocus, true);
|
||||
});
|
||||
|
||||
testWidgets('TextButton does not crash at zero area', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: Center(
|
||||
child: SizedBox.shrink(
|
||||
child: TextButton(onPressed: () {}, child: const Text('X')),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
expect(tester.getSize(find.byType(TextButton)), Size.zero);
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user