Skip to content

Commit 3d3e2eb

Browse files
Make sure that a CupertinoDesktopTextSelectionToolbar doesn't crash i… (flutter#173964)
This is my attempt to handle flutter#6537 for the CupertinoDesktopTextSelectionToolbar UI control. --------- Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
1 parent 246a6a2 commit 3d3e2eb

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

packages/flutter/test/cupertino/desktop_text_selection_toolbar_test.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,22 @@ void main() {
127127
greaterThan(anchor),
128128
);
129129
});
130+
131+
testWidgets('CupertinoDesktopTextSelectionToolbar does not crash at zero area', (
132+
WidgetTester tester,
133+
) async {
134+
await tester.pumpWidget(
135+
CupertinoApp(
136+
home: Center(
137+
child: SizedBox.shrink(
138+
child: CupertinoDesktopTextSelectionToolbar(
139+
anchor: const Offset(10, 10),
140+
children: const <Widget>[Text('X')],
141+
),
142+
),
143+
),
144+
),
145+
);
146+
expect(tester.getSize(find.byType(CupertinoDesktopTextSelectionToolbar)), Size.zero);
147+
});
130148
}

0 commit comments

Comments
 (0)