Skip to content

Create rich tooltip for Flutter frames in the performance view #3493

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 6 commits into from
Nov 10, 2021

Conversation

Image for: Conversation
Copy link
Member

kenzieschmoll commented Nov 10, 2021

Fixes #3139

This PR also has some cleanup like creating a LinkTextSpan helper widget and using where appropriate, moving the hover.dart file to a common location, etc.

double _calculateTooltipWidth(List<String> lines) {
var maxWidth = 0.0;
for (final line in lines) {
final textPainter = TextPainter(
Copy link
Member

Choose a reason for hiding this comment

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

Could use / modify calcluateTextSpanWidth helper function instead:

/// Returns the width in pixels of the [span].
double calculateTextSpanWidth(TextSpan span) {
final textPainter = TextPainter(
text: span,
textAlign: TextAlign.left,
textDirection: TextDirection.ltr,
)..layout();
return textPainter.width;
}

Copy link
Member Author

Choose a reason for hiding this comment

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

good suggestion - done

Copy link
Member

elliette left a comment

Choose a reason for hiding this comment

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

One suggestion but LGTM!

kenzieschmoll merged commit 1928974 into flutter:master Nov 10, 2021
kenzieschmoll deleted the flutter-frame-tooltip branch November 10, 2021 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants