-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Text inline widgets, TextSpan rework #30069
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@GaryQian lets make that widgets placed as inline text widgets can also contribute semantics |
|
Have checked that semantics are being correctly built up and passed through, although I will verify with some people who are more familiar with semantics if it is indeed the full behavior |
goderbauer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| hitTest: (BoxHitTestResult result, Offset transformed) { | ||
| assert(() { | ||
| final Offset manualPosition = (position - textParentData.offset) / textParentData.scale; | ||
| // Compare the two offsets ignoring floating point error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove this comment? It's rather obvious what's happening below, I think.
|
Due to versioning calculation, #33794 squashes this PR on top of master. Further changes can be seen there. |
|
Closing this, will be landing the other version. |
…backwards compatibility (#34051)
This PR implements the capability of embedding widgets inline into paragraphs.
New TextSpan inheritance structure is the following:
Wrap widgets to embed in
WidgetSpan(widget: <yourwidgethere>)The TextSpan changes make this a breaking change, although existing code passing
<TextSpan>[]intoRichTextorTextPaintershould still work as expected. Only code directly modifying a InlineSpan tree will be affected.Fix/Addition for #2022
Dependent on the engine/LibTxt side PR: flutter/engine#8207
Work continued in #33946