Add RichText support to find.text()#87197
Merged
dnfield merged 10 commits intoflutter:masterfrom Aug 23, 2021
Merged
Conversation
Contributor
Author
goderbauer
reviewed
Jul 28, 2021
Contributor
Author
|
Hi @goderbauer - I addressed all of your concerns. Can you review again? :) |
goderbauer
reviewed
Aug 3, 2021
| /// [Text] and [Text.rich] widgets) are matched by comparing the | ||
| /// [InlineSpan.toPlainText] with the given `text`. | ||
| /// If `skipRichText` is enabled, all standalone [RichText] widgets are | ||
| /// ignored and [Text] matching shortcuts to [Text.data]. |
Member
There was a problem hiding this comment.
This sounds confusing, maybe better:
Suggested change
| /// ignored and [Text] matching shortcuts to [Text.data]. | |
| /// ignored and `text` is matched with [Text.data]. |
Contributor
Author
|
@goderbauer I addressed your comments from code review. |
Member
|
Looks the analyzer is unhappy and some tests are failing. Can you take a look? |
Contributor
Author
|
@goderbauer Thanks - I cannot believe I missed that; updated it. |
goderbauer
approved these changes
Aug 17, 2021
Member
goderbauer
left a comment
There was a problem hiding this comment.
LGTM after nits are fixed.
Co-authored-by: Michael Goderbauer <[email protected]>
Contributor
Author
|
@goderbauer done 👍 |
Contributor
Author
|
@dnfield thx a lot ❤️ |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds support for matching standalone
RichTextwidgets tofind.text()in a backwards-compatible manner. That is, this does not break any existing tests (which #21964 did).It adds the arguably better strategy for matching
Textwidgets (using onlyRichText) behind askipRichTextflag that has to be set tofalse.Documentation
I have added both extensive additions to the existing
find.text()docs as well as a comment to explain why we are using the inferiorwidget is Textmethod of looking upTextwidgets (when we could just always only look forRichTextas that is also inserted byTextwidgets).Tests
I have added test cases for every possible scenario, which ensures that both the new
skipRichText: falsestrategy finds every text widget once, as well as testing that the old strategy does not matchRichTextat all.The semantics test case is taken from #21964.
Issues
This resolves a popular issue:
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.