overflow_view icon indicating copy to clipboard operation
overflow_view copied to clipboard

Implement wrapped items

Open thanhle1547 opened this issue 3 years ago • 7 comments

Hey @letsar, I implemented the #2 enhancement request (Wrapped items). The example is also updated.

The picture below is an example that demonstrates how to control maximum number of rows/columns via parameters maxRun and maxItemPerRun.

overflow_view pr enhancement request 2

thanhle1547 avatar Jun 18 '22 07:06 thanhle1547

Thank you for the PR. Exactly what I was looking for. However will be cool if it is possible to calculate the height and width without specifying the maxRun

Mayb3Nots avatar Oct 16 '22 17:10 Mayb3Nots

Now you don't need to specify the maxRun @Mayb3Nots

thanhle1547 avatar Oct 23 '22 15:10 thanhle1547

Now you don't need to specify the maxRun @Mayb3Nots

Wow it seems like the RenderBox already does the calculation and the maxRun wasn't required in the first place? Ive tried to understand how it works under the hood but its very complicated with tons of math 😂. I wonder how did you come to learn to implement so low-level widgets? I also have a question about performance, since from what I can tell we do calculations on intrinsic height and width so will it be costly in terms of performance if the children's are complicated and in huge amounts of numbers? Thanks again you inspire me to learn more about flutter low level framework.

Mayb3Nots avatar Oct 23 '22 15:10 Mayb3Nots

it seems like the RenderBox already does the calculation and the maxRun wasn't required in the first place?

The maxRun is used to check whether to continue layout other children.

how did you come to learn to implement so low-level widgets?

I start coding! 😁 (Besides taking time to study Flutter source code & read API docs).

do calculations on intrinsic height and width so will it be costly in terms of performance if the children's are complicated and in huge amounts of numbers?

This video gives some explanations which specifically help with your question.

Keep going 🚀

thanhle1547 avatar Oct 26 '22 10:10 thanhle1547

Hi @thanhle1547, thanks again for your hard work. However while using your PR when there is 15 item in the children's I'm getting an error RangeError (index): Invalid value: Valid value range is empty: -1 in line 905. Any advice?

Mayb3Nots avatar Mar 02 '23 14:03 Mayb3Nots