Fixing richMessage gesture recognizer in tooltip widget (#126207)
Fixing #126206 and #113388 issues *The IgnorePointer is preventing the richMessage touch events being recognized. Just removing that from* *Solves #126206 and #113388*
This commit is contained in:
parent
682dd3bdc8
commit
434b81f1a5
@ -850,8 +850,7 @@ class _TooltipOverlay extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
Widget result = IgnorePointer(
|
Widget result = FadeTransition(
|
||||||
child: FadeTransition(
|
|
||||||
opacity: animation,
|
opacity: animation,
|
||||||
child: ConstrainedBox(
|
child: ConstrainedBox(
|
||||||
constraints: BoxConstraints(minHeight: height),
|
constraints: BoxConstraints(minHeight: height),
|
||||||
@ -873,7 +872,6 @@ class _TooltipOverlay extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
|
||||||
);
|
);
|
||||||
if (onEnter != null || onExit != null) {
|
if (onEnter != null || onExit != null) {
|
||||||
result = MouseRegion(
|
result = MouseRegion(
|
||||||
|
@ -1906,6 +1906,36 @@ void main() {
|
|||||||
expect(find.byType(SizedBox), findsOneWidget);
|
expect(find.byType(SizedBox), findsOneWidget);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
testWidgetsWithLeakTracking('Tooltip should not ignore users tap on richMessage', (WidgetTester tester) async {
|
||||||
|
bool isTapped = false;
|
||||||
|
|
||||||
|
await tester.pumpWidget(
|
||||||
|
MaterialApp(
|
||||||
|
home: Tooltip(
|
||||||
|
richMessage: TextSpan(
|
||||||
|
text: tooltipText,
|
||||||
|
recognizer: TapGestureRecognizer()..onTap = () {
|
||||||
|
isTapped = true;
|
||||||
|
}
|
||||||
|
),
|
||||||
|
showDuration: const Duration(seconds: 5),
|
||||||
|
triggerMode: TooltipTriggerMode.tap,
|
||||||
|
child: const Icon(Icons.refresh)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
final Finder tooltip = find.byType(Tooltip);
|
||||||
|
expect(find.text(tooltipText), findsNothing);
|
||||||
|
|
||||||
|
await _testGestureTap(tester, tooltip);
|
||||||
|
final Finder textSpan = find.text(tooltipText);
|
||||||
|
expect(textSpan, findsOneWidget);
|
||||||
|
|
||||||
|
await _testGestureTap(tester, textSpan);
|
||||||
|
expect(isTapped, isTrue);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> setWidgetForTooltipMode(
|
Future<void> setWidgetForTooltipMode(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user