Revert "Add RichText support to find.text" (#22046)
This commit is contained in:
@@ -498,22 +498,6 @@ class _TextFinder extends MatchFinder {
|
||||
} else if (candidate.widget is EditableText) {
|
||||
final EditableText editable = candidate.widget;
|
||||
return editable.controller.text == text;
|
||||
} else if (candidate.widget is RichText) {
|
||||
bool parentIsText = false;
|
||||
// check if the direct parent is a Text widget. if so, do not match it
|
||||
// twice. We make an exception for semantics since those may be placed
|
||||
// between a Text and Rich text.
|
||||
candidate.visitAncestorElements((Element parent) {
|
||||
if (parent.widget is Text) {
|
||||
parentIsText = true;
|
||||
return false;
|
||||
} else if (parent.widget is ExcludeSemantics || parent.widget is Semantics) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
final RichText richText = candidate.widget;
|
||||
return !parentIsText && richText.text.toPlainText() == text;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user