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

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

Merged
merged 6 commits into from
Nov 10, 2021

Conversation

kenzieschmoll
Copy link
Member

@kenzieschmoll kenzieschmoll commented Nov 10, 2021

Fixes #3139
Screen Shot 2021-11-10 at 10 58 22 AM
Screen Shot 2021-11-10 at 10 57 46 AM

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 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 kenzieschmoll merged commit 1928974 into flutter:master Nov 10, 2021
@kenzieschmoll 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support a rich tooltip for frames in the flutter frames chart
2 participants