mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Make sure that a CupertinoFocusHalo doesn't crash in 0x0 environment (#178773)
This is my attempt to handle https://github.com/flutter/flutter/issues/6537 for the CupertinoFocusHalo 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
5be16afd7f
commit
07e1cdd9ff
@ -172,4 +172,23 @@ void main() {
|
||||
expect(findBorder(group2Key, tester), getExpectedHaloBorder());
|
||||
},
|
||||
);
|
||||
|
||||
testWidgets('CupertinoFocusHalo does not crash at zero area', (WidgetTester tester) async {
|
||||
final focusNode = FocusNode();
|
||||
addTearDown(focusNode.dispose);
|
||||
await tester.pumpWidget(
|
||||
CupertinoApp(
|
||||
home: Center(
|
||||
child: SizedBox.shrink(
|
||||
child: CupertinoFocusHalo.withRect(
|
||||
child: Focus(focusNode: focusNode, child: const Text('X')),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
focusNode.requestFocus();
|
||||
await tester.pumpAndSettle();
|
||||
expect(tester.getSize(find.byType(CupertinoFocusHalo)), Size.zero);
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user