Open kf6gpe opened 5 years ago
Something that covered when to use which of the following:
/cc @goderbauer and @Piinks who probably have some good ideas.
@kf6gpe @dnfield I would like to work on it!
Hello! I want to start my contribution to this repo. Can I take up this issue?
@0xapurv or @arps18 : Please give this a try. Let us know if you have issues.
@miquelbeltran, do you have specific advice for this one?
We can find these widgets either as "scrollables" (https://docs.flutter.dev/ui/widgets/scrolling) or as "multi-child" layout widgets (https://docs.flutter.dev/ui/widgets/layout) in the documentation.
These two pages already provide a short description of what the widget purpose is, but then you need to go deeper into the documentation to find out which is the recommended use in terms of performance:
For example the ListView
docs explain the differences between passing a list as children
, or using the builder
and custom
factory constructors, and it notes that builder
is more efficient. https://api.flutter.dev/flutter/widgets/ListView-class.html
I think it would be good to extract part of that information from the widget docs into an "Overview" page under Layouts > Lists & grids on the side menu of the website that guides the developer into which type of list choose depending on the task.
I'd not go into detail of performance, but rather the usecase: e.g. if you have few items that will be visible most of the time, use ListView()
, and then link the user to the existing cookbook. If you have a large number of items that are all similar, use ListView.builder()
, etc.
We see a lot of people on the flutter/flutter/issues asking questions about which list widget to use for different purposes (e.g., different sized items, for best performance, etc). It would be good to have a one-page tutorial with a table with some ranking criteria across the top and the various choices for lists in rows, with color shading for good/bad results.
cc @dnfield for the idea.