-
Notifications
You must be signed in to change notification settings - Fork 336
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
Create rich tooltip for Flutter frames in the performance view #3493
Conversation
double _calculateTooltipWidth(List<String> lines) { | ||
var maxWidth = 0.0; | ||
for (final line in lines) { | ||
final textPainter = TextPainter( |
There was a problem hiding this comment.
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:
devtools/packages/devtools_app/lib/src/ui/utils.dart
Lines 47 to 56 in fa91248
/// 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; | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good suggestion - done
There was a problem hiding this 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!
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.