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

Fix inspector scrollbars. #2709

Merged
merged 2 commits into from
Feb 18, 2021
Merged

Conversation

jacob314
Copy link
Contributor

@jacob314 jacob314 commented Feb 17, 2021

Inspector rows are now aware of how much space they have in the viewable window so that we can do a better job highlighting rows like this:
Screen Shot 2021-02-17 at 12 33 26 PM
fixing
#2684

and text truncates when it reaches the end of the visible area like this:
Screen Shot 2021-02-17 at 1 06 03 PM

As a followup I'd like to polish how the erros are shown in the tree as.

Mostly fixes #2626
as we now truncate long lines with ... instead of broken wrapping.

Fixes
#2674
but adding keys so inspector state objects are reused better.

@jacob314 jacob314 changed the title Fix inspector scrollbars. [draft do not review] Fix inspector scrollbars. Feb 17, 2021
@@ -69,6 +69,9 @@ class InspectorScreenBodyState extends State<InspectorScreenBody>
bool get enableButtons =>
actionInProgress == false && connectionInProgress == false;

static const summaryTreeKey = Key('Summary Tree');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This helps ensure inspector tree state widgets are reused when they should which avoids a known bug in the flutter scrollbars as well as helping performance a little.

row: row,
error:
widget.widgetErrors != null && inspectorRef != null
return LayoutBuilder(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

make sure to view this change with hide whitespace diffs.

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.

LGTM with a few nits

double get safeViewportHeight {
return _scrollControllerY.hasClients
? _scrollControllerY.position.viewportDimension
: 1000.0;
Copy link
Member

Choose a reason for hiding this comment

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

put this in a const with a name that describes what it is

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

return AnimatedBuilder(
animation: widget.offsetController,
builder: (context, child) {
// Compute a delta so that
Copy link
Member

Choose a reason for hiding this comment

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

nit: incomplete comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

child: Transform.translate(
offset: -offset,
child: child,
)),
Copy link
Member

Choose a reason for hiding this comment

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

nit: trailing comma

@jacob314 jacob314 merged commit 78b9b69 into flutter:master Feb 18, 2021
@jacob314 jacob314 deleted the inspector_scroll branch February 18, 2021 16:35
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.

DevTools Inspector Details Tree rendering error
2 participants