@@ -16,9 +16,9 @@ void main() {
1616 ),
1717 );
1818
19- // Get the only RichText widget in the tree
20- final richTextWidget = tester.widget <RichText >(find.byType (RichText ));
21- final rootSpan = richTextWidget.text as TextSpan ;
19+ // Get the Text widget that uses Text.rich
20+ final textWidget = tester.widget <Text >(find.byType (Text ));
21+ final rootSpan = textWidget.textSpan ! as TextSpan ;
2222
2323 // Combine all spans into a single string
2424 final fullText = rootSpan.children! .map ((span) => (span as TextSpan ).text).join ();
@@ -42,8 +42,8 @@ void main() {
4242 ),
4343 );
4444
45- final richText = tester.widget <RichText >(find.byType (RichText ));
46- final rootSpan = richText.text as TextSpan ;
45+ final textWidget = tester.widget <Text >(find.byType (Text ));
46+ final rootSpan = textWidget.textSpan ! as TextSpan ;
4747
4848 final annotatedSpan = rootSpan.children! [1 ]; // "world"
4949 expect ((annotatedSpan as TextSpan ).style! .color, equals (annotationStyle.color));
@@ -61,9 +61,9 @@ void main() {
6161 ),
6262 );
6363
64- // Get the RichText widget
65- final richTextWidget = tester.widget <RichText >(find.byType (RichText ));
66- final rootSpan = richTextWidget.text as TextSpan ;
64+ // Get the Text widget that uses Text.rich
65+ final textWidget = tester.widget <Text >(find.byType (Text ));
66+ final rootSpan = textWidget.textSpan ! as TextSpan ;
6767
6868 // Locate the annotated span (second span in the children list)
6969 final annotatedSpan = rootSpan.children! [1 ] as TextSpan ;
0 commit comments