Skip to content
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

Implement wrapped items #9

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

thanhle1547
Copy link

@thanhle1547 thanhle1547 commented Jun 18, 2022

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

@Mayb3Nots
Copy link

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

@thanhle1547
Copy link
Author

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

@Mayb3Nots
Copy link

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.

@thanhle1547
Copy link
Author

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 🚀

@Mayb3Nots
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants