@@ -1508,6 +1508,60 @@ void main() {
15081508 expect (find.text (tooltipText), findsNothing);
15091509 });
15101510
1511+ // Regression test for https://github.com/flutter/flutter/issues/141644.
1512+ // This allows the user to quickly explore the UI via tooltips.
1513+ testWidgets ('Tooltip shows without delay when the mouse moves from another tooltip' , (WidgetTester tester) async {
1514+ const Duration waitDuration = Durations .extralong1;
1515+ final TestGesture gesture = await tester.createGesture (kind: PointerDeviceKind .mouse);
1516+ addTearDown (() async {
1517+ return gesture.removePointer ();
1518+ });
1519+ await gesture.addPointer ();
1520+ await gesture.moveTo (const Offset (1.0 , 1.0 ));
1521+ await tester.pump ();
1522+ await gesture.moveTo (Offset .zero);
1523+
1524+ await tester.pumpWidget (
1525+ const MaterialApp (
1526+ home: Column (
1527+ children: < Widget > [
1528+ Tooltip (
1529+ message: 'first tooltip' ,
1530+ waitDuration: waitDuration,
1531+ child: SizedBox (
1532+ width: 100.0 ,
1533+ height: 100.0 ,
1534+ ),
1535+ ),
1536+ Tooltip (
1537+ message: 'last tooltip' ,
1538+ waitDuration: waitDuration,
1539+ child: SizedBox (
1540+ width: 100.0 ,
1541+ height: 100.0 ,
1542+ ),
1543+ ),
1544+ ],
1545+ ),
1546+ ),
1547+ );
1548+
1549+ await gesture.moveTo (Offset .zero);
1550+ await tester.pump ();
1551+ await gesture.moveTo (tester.getCenter (find.byType (Tooltip ).first));
1552+ await tester.pump ();
1553+ // Wait for the first tooltip to appear.
1554+ await tester.pump (waitDuration);
1555+ expect (find.text ('first tooltip' ), findsOneWidget);
1556+ expect (find.text ('last tooltip' ), findsNothing);
1557+
1558+ // Move to the second tooltip and expect it to show up immediately.
1559+ await gesture.moveTo (tester.getCenter (find.byType (Tooltip ).last));
1560+ await tester.pump ();
1561+ expect (find.text ('first tooltip' ), findsNothing);
1562+ expect (find.text ('last tooltip' ), findsOneWidget);
1563+ });
1564+
15111565 testWidgets ('Tooltip text is also hoverable' , (WidgetTester tester) async {
15121566 const Duration waitDuration = Duration .zero;
15131567 final TestGesture gesture = await tester.createGesture (kind: PointerDeviceKind .mouse);
0 commit comments