Skip to content
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

Text inline widgets, TextSpan rework #30069

Closed
wants to merge 101 commits into from

Conversation

Projects
None yet
7 participants
@GaryQian
Copy link
Contributor

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

GaryQian added some commits Mar 27, 2019

GaryQian added some commits Mar 27, 2019

GaryQian added some commits Mar 28, 2019

@jonahwilliams

This comment has been minimized.

Copy link
Contributor

commented Mar 29, 2019

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

GaryQian added some commits Mar 30, 2019

@GaryQian

This comment has been minimized.

Copy link
Contributor Author

commented Mar 30, 2019

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

GaryQian added some commits May 30, 2019

Show resolved Hide resolved packages/flutter/lib/src/painting/inline_span.dart Outdated
Show resolved Hide resolved packages/flutter/lib/src/painting/inline_span.dart Outdated
Show resolved Hide resolved packages/flutter/lib/src/painting/inline_span.dart Outdated
Show resolved Hide resolved packages/flutter/lib/src/painting/inline_span.dart Outdated
Show resolved Hide resolved packages/flutter/lib/src/painting/inline_span.dart Outdated
Show resolved Hide resolved packages/flutter/lib/src/rendering/paragraph.dart Outdated
Show resolved Hide resolved packages/flutter/lib/src/rendering/paragraph.dart Outdated
Show resolved Hide resolved packages/flutter/lib/src/rendering/paragraph.dart Outdated
Show resolved Hide resolved packages/flutter/lib/src/rendering/paragraph.dart Outdated
Show resolved Hide resolved packages/flutter/lib/src/widgets/widget_span.dart Outdated

GaryQian added some commits May 31, 2019

GaryQian added some commits May 31, 2019

GaryQian added some commits May 31, 2019

@goderbauer
Copy link
Member

left a comment

LGTM

@@ -415,11 +415,8 @@ class RenderParagraph extends RenderBox
assert(() {
final Offset manualPosition = (position - textParentData.offset) / textParentData.scale;
// Compare the two offsets ignoring floating point error.

This comment has been minimized.

Copy link
@goderbauer

goderbauer May 31, 2019

Member

nit: remove this comment? It's rather obvious what's happening below, I think.

@GaryQian

This comment has been minimized.

Copy link
Contributor Author

commented Jun 3, 2019

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

@GaryQian

This comment has been minimized.

Copy link
Contributor Author

commented Jun 4, 2019

Closing this, will be landing the other version.

@GaryQian GaryQian closed this Jun 4, 2019

GaryQian added a commit that referenced this pull request Jun 7, 2019

Kiku-Reise added a commit to Kiku-Reise/flutter that referenced this pull request Jun 14, 2019

goderbauer added a commit to goderbauer/flutter that referenced this pull request Jul 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.