-
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
Fix inspector scrollbars. #2709
Conversation
896cbf5
to
4282399
Compare
4282399
to
8980884
Compare
@@ -69,6 +69,9 @@ class InspectorScreenBodyState extends State<InspectorScreenBody> | |||
bool get enableButtons => | |||
actionInProgress == false && connectionInProgress == false; | |||
|
|||
static const summaryTreeKey = Key('Summary Tree'); |
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.
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( |
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.
make sure to view this change with hide whitespace diffs.
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.
LGTM with a few nits
double get safeViewportHeight { | ||
return _scrollControllerY.hasClients | ||
? _scrollControllerY.position.viewportDimension | ||
: 1000.0; |
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.
put this in a const with a name that describes what it is
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.
done
return AnimatedBuilder( | ||
animation: widget.offsetController, | ||
builder: (context, child) { | ||
// Compute a delta so that |
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.
nit: incomplete comment
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.
done
child: Transform.translate( | ||
offset: -offset, | ||
child: child, | ||
)), |
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.
nit: trailing comma
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:
fixing
#2684
and text truncates when it reaches the end of the visible area like this:
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.