-
Notifications
You must be signed in to change notification settings - Fork 326
Offer more Builders when wrapping widgets #4540
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
Comments
For me, personally, the structure is all that matters. I haven't found much value in filling in the name of a widget. Instead, the value is generating the Builders are the most problematic because most builder functions differ in signature, and on top of that, they all take different required parameters. I'm not the sure the heuristic of "widgets...most common in user code" is necessarily a good one because the frequency of use doesn't reflect the tediousness of adding the widget. If you again consider something like PS - I understand that the needs of beginner Flutter developers may be different here. I am transparently saying this as someone who knows most of the widgets that are available. |
I agree it's valuable for the IDE to fill out the template of a builder. Should this be done through code completion or refactor assists, as in the original post, or both? |
Perhaps both, but in my case, I always end up adding a builder after I've built out part of my tree. Usually I realize I need one, or I integrate data that wasn't there before. So code completion would not help my use cases. |
Maybe it might be better to offer separate a menu/popup with the various builder types and preserve the current menu for those who use it or who may be intimidated by a long list of widgets. Definitely agree with @matthew-carroll, since Animation, Layout, and ValueListenable are some of the most common builders people use. |
I've been thinking about this a bit and trying to find a precedent where an assist/intention invokes a popup/dialog. @alexander-doroshko? |
@pq For intentions that modify code, showing a dialog sounds like a too heavy solution. Lightweight popups that don't require user action but allow to change something in the intention behavior look more appropriate. But this will probably require changes both in the Analysis Server protocol and in the Dart plugin. By the way, Analysis Server and IntelliJ already support so called 'linked edits' with suggestions list. Can they help to improve the wrapping usability? |
How about replacing "Wrap with StreamBuilder >" with "Wrap with a builder >" that shows a sub-menu of different kinds of builders? |
I think that's worth a try if it can be done. I think the frequency of use is low enough, and the value of the generator is high enough to make a submenu worth the extra click. |
@alexander-doroshko I'm wondering what you would recommend for how to handle a situation like this. |
@bwilkerson, @alexander-doroshko suggested this idea above:
What do think? |
@bwilkerson Is the 'linked edits' concept enough for the task? In this case a single 'Wrap with a builder' quick assist that will open a list of applicable builders sounds good to me. And this won't require any changes in the protocol or in the Dart plugin. But I speak for technical solutions only. Flutter plugin engineers might want to run a UX study to check whether such change makes the feature more or less discoverable / convenient / often used. |
Sorry, I missed the earlier comment on linked edits. @matthew-carroll @InMatrix Interested to hear what you think. In case you're not familiar with it, you can see the UX by creating a file containing
place the cursor inside |
@matthew-carroll (or anyone): could you describe some of the template content you'd like to see generated for some select builders? Is there anything generalizable or does it vary greatly between specific builder implementations? |
@pq Is there a limit from IntelliJ on this dropbox? IMHO the more options the better since searching and pressing takes way less time than typing even for a larger list. Maybe sort alphabetically.
|
@pq I guess I missed some of the followup messages here a year ago. Here are some examples of what I'd expect to see generated for a few different builders:
And then perhaps support for a "generic builder", which won't completely satisfy any builder, but would be a nice headstart for custom builders:
I do think this is worth some UX investigation. CC @InMatrix |
Thanks for the added context @matthew-carroll! |
I'd like for the "wrap widget" context menu to offer a greater selection of builders, e.g.,
AnimatedBuilder
andLayoutBuilder
.When it comes to single-child widgets, and even multi-child widgets, it's easy to select a similar widget and then rename it. For example, if I want a
Stack
, it's not available in the context menu, but I can easily selectColumn
and then rename it. However,Builder
s are not so easily substituted.Builder
s have varying additional arguments, e.g.,Stream
,Listenable
, etc. Moreover, the builder delegate signature varies betweenBuilder
s.Providing more
Builder
s would be a much bigger time saver for me than having a long list of interchangeable widgets.The text was updated successfully, but these errors were encountered: