-
Notifications
You must be signed in to change notification settings - Fork 337
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
Debugger: soft wrap console input lines #8855
base: master
Are you sure you want to change the base?
Conversation
super.key, | ||
}) : searchFieldHeight = searchFieldHeight ?? defaultTextFieldHeight; | ||
}) : searchFieldHeight = searchFieldHeight ?? defaultTextFieldHeight, | ||
_shouldExpandHeight = shouldExpandHeight; |
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.
is there a reason this is a private field? Can shouldExpandHeight just be a public field so that we can use this.shouldExpandHeight = true
in the constructor parameter?
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.
Also, should the default value be false
to match the code below?
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.
See #8855 (comment) before addressing this 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.
Only in order to prefer private fields. https://dart.dev/effective-dart/design#prefer-making-declarations-private
It improves static analysis (like you are told when the field could be final, or is unused). It sends readability signals that the field is not intended to be read or written from outside the library. And the price you pay is that you can't use this.
in the constructor parameter.
If there is a style in DevTools that is counter to this Effective Dart guideline, we can document that and prefer public.
@@ -970,7 +980,8 @@ class StatelessSearchField<T extends SearchableDataMixin> | |||
this.suffix, | |||
this.style, | |||
this.searchFieldHeight, | |||
}); | |||
bool shouldExpandHeight = false, | |||
}) : _shouldExpandHeight = shouldExpandHeight; |
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.
same question here: can we just make this public so that we can use this.shouldExpandHeight = false
in the constructor?
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.
see #8855 (comment) before addressing this comment.
@@ -1032,6 +1046,7 @@ class StatelessSearchField<T extends SearchableDataMixin> | |||
focusNode: controller.searchFieldFocusNode, | |||
controller: controller.searchTextFieldController, | |||
style: textStyle, | |||
maxLines: _shouldExpandHeight ? null : 1, |
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.
what if instead of having this shouldExpandHeight functionality, we just allow maxLines to be passed through? This would also allow us to constrain the height of the console input to some desired max, like 3 lines for example.
@@ -35,7 +35,8 @@ TODO: Remove this section if there are not any general updates. | |||
|
|||
## Debugger updates | |||
|
|||
TODO: Remove this section if there are not any general updates. | |||
* The console in the debugger now soft wraps lines. |
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.
Verbiage nit: entries should be phrased in the past tense (e.g. "Added XYZ" instead of "Add XYZ").
See #5505 for original issue screenshot. Here is another:
Afterwards, we get this nice expanding behavior:
The console itself is still expandable:
Fixes #5505