Skip to content

Add text previews to widget tree #3218

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

Merged
merged 3 commits into from
Aug 3, 2021

Conversation

tomgilder
Copy link
Contributor

As discussed in #3195.

For now this only brings the text preview for RenderParagraph objects, such as Text and RichText:

Screenshot 2021-07-23 at 22 15 48

We probably want to support other widgets such as SelectableText, but those will require special cases.

Am in the process of adding tests hence the draft, but I wanted to check you're happy with this implementation of adding an extra polyfill script @jacob314 @kenzieschmoll?

@tomgilder tomgilder marked this pull request as draft July 23, 2021 19:17
Copy link
Member

@kenzieschmoll kenzieschmoll left a comment

Choose a reason for hiding this comment

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

This approach LGTM 👍

if (description?.isNotEmpty == true) {
yield TextSpan(text: description, style: textStyle);
}

final textPreview = diagnostic.json['textPreview'];
if (textPreview is String) {
Copy link
Member

Choose a reason for hiding this comment

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

should we be checking for is String or != null ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I now need to check it's a string to strip newlines from it

@tomgilder tomgilder marked this pull request as ready for review July 29, 2021 18:16
@@ -0,0 +1,63 @@
import 'package:devtools_app/src/inspector/diagnostics_node.dart';
Copy link
Member

Choose a reason for hiding this comment

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

missing copyright header

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@kenzieschmoll kenzieschmoll merged commit 5d17c45 into flutter:master Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants