File tree Expand file tree Collapse file tree 2 files changed +48
-20
lines changed Expand file tree Collapse file tree 2 files changed +48
-20
lines changed Original file line number Diff line number Diff line change @@ -850,30 +850,28 @@ class _TooltipOverlay extends StatelessWidget {
850
850
851
851
@override
852
852
Widget build (BuildContext context) {
853
- Widget result = IgnorePointer (
854
- child: FadeTransition (
855
- opacity: animation,
856
- child: ConstrainedBox (
857
- constraints: BoxConstraints (minHeight: height),
858
- child: DefaultTextStyle (
859
- style: Theme .of (context).textTheme.bodyMedium! ,
860
- child: Container (
861
- decoration: decoration,
862
- padding: padding,
863
- margin: margin,
864
- child: Center (
865
- widthFactor: 1.0 ,
866
- heightFactor: 1.0 ,
867
- child: Text .rich (
868
- richMessage,
869
- style: textStyle,
870
- textAlign: textAlign,
871
- ),
853
+ Widget result = FadeTransition (
854
+ opacity: animation,
855
+ child: ConstrainedBox (
856
+ constraints: BoxConstraints (minHeight: height),
857
+ child: DefaultTextStyle (
858
+ style: Theme .of (context).textTheme.bodyMedium! ,
859
+ child: Container (
860
+ decoration: decoration,
861
+ padding: padding,
862
+ margin: margin,
863
+ child: Center (
864
+ widthFactor: 1.0 ,
865
+ heightFactor: 1.0 ,
866
+ child: Text .rich (
867
+ richMessage,
868
+ style: textStyle,
869
+ textAlign: textAlign,
872
870
),
873
871
),
874
872
),
875
873
),
876
- )
874
+ ),
877
875
);
878
876
if (onEnter != null || onExit != null ) {
879
877
result = MouseRegion (
Original file line number Diff line number Diff line change @@ -1906,6 +1906,36 @@ void main() {
1906
1906
expect (find.byType (SizedBox ), findsOneWidget);
1907
1907
}
1908
1908
});
1909
+
1910
+ testWidgetsWithLeakTracking ('Tooltip should not ignore users tap on richMessage' , (WidgetTester tester) async {
1911
+ bool isTapped = false ;
1912
+
1913
+ await tester.pumpWidget (
1914
+ MaterialApp (
1915
+ home: Tooltip (
1916
+ richMessage: TextSpan (
1917
+ text: tooltipText,
1918
+ recognizer: TapGestureRecognizer ()..onTap = () {
1919
+ isTapped = true ;
1920
+ }
1921
+ ),
1922
+ showDuration: const Duration (seconds: 5 ),
1923
+ triggerMode: TooltipTriggerMode .tap,
1924
+ child: const Icon (Icons .refresh)
1925
+ ),
1926
+ ),
1927
+ );
1928
+
1929
+ final Finder tooltip = find.byType (Tooltip );
1930
+ expect (find.text (tooltipText), findsNothing);
1931
+
1932
+ await _testGestureTap (tester, tooltip);
1933
+ final Finder textSpan = find.text (tooltipText);
1934
+ expect (textSpan, findsOneWidget);
1935
+
1936
+ await _testGestureTap (tester, textSpan);
1937
+ expect (isTapped, isTrue);
1938
+ });
1909
1939
}
1910
1940
1911
1941
Future <void > setWidgetForTooltipMode (
You can’t perform that action at this time.
0 commit comments