Offer more Builders when wrapping widgets
See original GitHub issueI’d like for the “wrap widget” context menu to offer a greater selection of builders, e.g., AnimatedBuilder
and LayoutBuilder
.
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 select Column
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 between Builder
s.
Providing more Builder
s would be a much bigger time saver for me than having a long list of interchangeable widgets.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:10
- Comments:17 (7 by maintainers)
Top Results From Across the Web
Flutter Wrap & List.generate | Row & Column Layout - YouTube
You will learn how to use Wrap widget with List.generate to generate dynamic widgets on the fly. You will also learn how to...
Read more >flutter - How can I improve the performance of Wrap Widget ...
Technically the idea of Wrap.builder wouldn't be a solution here because the issue persists even when all the items are in the displayed ......
Read more >Wrap Widget & Chip Widgets in Flutter - Vipin Vijayan - Medium
This helps to create a list of Chips to Select from one at a time. Widget choiceChips() { return Expanded( child: ListView.builder( itemCount:...
Read more >Wrap class - widgets library - Flutter - Dart API docs
API docs for the Wrap class from the widgets library, for the Dart programming ... properties) → void: Add additional properties associated with...
Read more >Flutter - Wrap Widget - GeeksforGeeks
Wrap widget aligns the widgets in a horizontal and vertical manner. Generally, we use Rows and Columns to do that but if we...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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
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
child:
line or thechildren:[]
array, or in the case of the builders, the actual builder function.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
LayoutBuilder
, I may only use that once in my app, but I’d be far more appreciative of not having to lookup that builder function signature online than I would to have quick access to aCenter
widget, which only saves me a couple seconds vs the generic “wrap with widget”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.