Very new to flutter WidgetTest and could not find a solution to a problem I am having. When dealing with TextSpan objects for WidgetTests, I'm unable to tap on the object.
UI Code
RichText(
text: TextSpan(
text: "First piece of text",
children: [
TextSpan(
text: "Text I want to tap in widget text",
recognizer: TapGestureRecognizer()
..onTap = () {
// go to another page i want to look for a text widget on
}),
],
),
)
WidgetTest code
Future<void> textSpanTap(WidgetTester tester) async {
await tester.pumpWidget(const MaterialApp(home: signInPage));
await tester.tap(find.text("Text I want to tap in widget text"));
}
Any insight on this would help.