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

Reland "Text inline widgets, TextSpan rework (#30069)" with improved backwards compatibility #34051

Merged
merged 21 commits into from Jun 7, 2019

Conversation

GaryQian
Copy link
Contributor

@GaryQian GaryQian commented Jun 7, 2019

This is another attempt at landing Text inline widgets (original PR with comments can be found here: https://github.com/flutter/flutter/pull/

This version adds the following backwards compatibility deprecated API:

  • InlineSpan.visitTextSpan
  • InlineSpan.text
  • InlineSpan.children

These deprecated APIs should allow InlineSpan to behave like the old TextSpans for instances of InlineSpan that are also TextSpans. getSpanForPosition now returns an InlineSpan, which may still break if you try to store the returned InlineSpan into a TextSpan.

These three deprecated APIs should be removed after the next stable release.

Diff from previous version: https://github.com/flutter/flutter/pull/34051/files/db2ed0acdbea7243917603e348b8b01585a7e590..3b08022762ea94b6fdf9570f00931bdafefac550

Previous version had LGTM.

@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 c: API break Backwards-incompatible API changes a: typography Text rendering, possibly libtxt labels Jun 7, 2019
@GaryQian GaryQian self-assigned this Jun 7, 2019
@GaryQian GaryQian changed the title Reland "Text inline widgets, TextSpan rework (#33794)" Reland "Text inline widgets, TextSpan rework (#30069)" Jun 7, 2019
@GaryQian GaryQian requested review from Hixie and amirh June 7, 2019 17:35
@GaryQian
Copy link
Contributor Author

GaryQian commented Jun 7, 2019

@Hixie @amirh This patch contains the deprecated API we discussed yesterday.

@amirh
Copy link
Contributor

amirh commented Jun 7, 2019

I still haven't completed the roll, please hold off on this until the roll succeeds.

@GaryQian GaryQian changed the title Reland "Text inline widgets, TextSpan rework (#30069)" Reland "Text inline widgets, TextSpan rework (#30069)" with improved backwards compatibility Jun 7, 2019
@GaryQian
Copy link
Contributor Author

GaryQian commented Jun 7, 2019

Yep, won't be landing this until your roll is all done.

///
/// This getter does not include the contents of its children.
@override
String get text => _text;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change and below should not be necessary. final fields are equivalent to a getter

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh thanks, good to know!

Copy link
Contributor Author

@GaryQian GaryQian Jun 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it override the getter without a @override? Update: it apparently will.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@override is an analyzer hint, but it is required for our lints

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... I think!

Copy link
Member

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@GaryQian GaryQian merged commit c2eaf83 into flutter:master Jun 7, 2019
kiku-jw pushed a commit to kiku-jw/flutter that referenced this pull request Jun 14, 2019
@Piinks Piinks mentioned this pull request Jan 11, 2021
9 tasks
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 6, 2021
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants