Skip to content

Conversation

@GaryQian
Copy link
Contributor

@GaryQian GaryQian commented Mar 27, 2019

This PR implements the capability of embedding widgets inline into paragraphs.

New TextSpan inheritance structure is the following:

InlineSpan --> TextSpan
         |
         ----> PlaceholderSpan ---> WidgetSpan

Wrap widgets to embed in WidgetSpan(widget: <yourwidgethere>)

The TextSpan changes make this a breaking change, although existing code passing <TextSpan>[] into RichText or TextPainter should 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

@GaryQian GaryQian added a: text input Entering text in a text field or keyboard related problems c: new feature Nothing broken; request for a new capability a: typography Text rendering, possibly libtxt work in progress; do not review labels Mar 27, 2019
@jonahwilliams
Copy link
Contributor

@GaryQian lets make that widgets placed as inline text widgets can also contribute semantics

@GaryQian
Copy link
Contributor Author

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 goderbauer added the framework flutter/packages/flutter repository. See also f: labels. label Mar 30, 2019
Copy link
Member

@goderbauer goderbauer left a 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.
Copy link
Member

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.

@GaryQian
Copy link
Contributor Author

GaryQian commented Jun 3, 2019

Due to versioning calculation, #33794 squashes this PR on top of master. Further changes can be seen there.

@GaryQian
Copy link
Contributor Author

GaryQian commented Jun 4, 2019

Closing this, will be landing the other version.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

a: text input Entering text in a text field or keyboard related problems a: typography Text rendering, possibly libtxt c: API break Backwards-incompatible API changes c: new feature Nothing broken; request for a new capability framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants