Widen getText support for RichText with multiple text spans in driver (#75603)

This commit is contained in:
Han van Venrooij
2021-02-11 02:01:08 +01:00
committed by GitHub
parent a178bba5d2
commit 09fd46a199
2 changed files with 17 additions and 3 deletions

View File

@@ -390,9 +390,10 @@ mixin CommandHandlerFactory {
text = (widget as Text).data;
} else if (widget.runtimeType == RichText) {
final RichText richText = widget as RichText;
if (richText.text.runtimeType == TextSpan) {
text = (richText.text as TextSpan).text;
}
text = richText.text.toPlainText(
includeSemanticsLabels: false,
includePlaceholders: false,
);
} else if (widget.runtimeType == TextField) {
text = (widget as TextField).controller?.text;
} else if (widget.runtimeType == TextFormField) {