karvulf / flutter-reorderable-grid-view

BSD 3-Clause "New" or "Revised" License
143 stars 20 forks source link

Issue: Lags with `ReorderableBuilder.builder` #107

Closed karvulf closed 2 weeks ago

karvulf commented 2 months ago

This issue is created because of #43 where there were problems using ReorderableBuilder.builder and scrolling through the items. After a couple of time, there were lags.

A suggestion was to remove setState for _handleMovingFinished and _handleOpacityFinished in ReorderableBuilder which causes a rebuilt for all children. But to ensure these children are correctly updating themself, somehow these widgets have to listen to changes of ReorderableEntity.

abdelaziz-mahdy commented 3 weeks ago

I hope you're doing well. I wanted to check if there have been any updates on this. I understand if you're busy, but I would appreciate knowing if it's possible.

karvulf commented 2 weeks ago

Hello @abdelaziz-mahdy I will try to find some time this weekend to see if I can find an improvement

abdelaziz-mahdy commented 2 weeks ago

Thank you ❤️

karvulf commented 2 weeks ago

Good morning @abdelaziz-mahdy I wanted to ask if you still have these issues with the newest flutter version 3.24.2? I tested it with Reorderable.builder on iPhone 15 and Galaxy Flip 3 and I didn't get any lags or not appearing images while scrolling. Every child got an image in this test. I will try to find a solution for the setState after the opacity finished anyway but probably flutter also improved the performance.

abdelaziz-mahdy commented 2 weeks ago

Good morning @abdelaziz-mahdy I wanted to ask if you still have these issues with the newest flutter version 3.24.2? I tested it with Reorderable.builder on iPhone 15 and Galaxy Flip 3 and I didn't get any lags or not appearing images while scrolling. Every child got an image in this test. I will try to find a solution for the setState after the opacity finished anyway but probably flutter also improved the performance.

Yeah flutter improved the performance but due to me rendering a list of images in which there is animation it takes time to build so I get a stutter, I am trying to optimize my list but any render reduction will be awesome

karvulf commented 2 weeks ago

I have made some changes which definitely improves the performance to 10 or more frames. Can you try if version 5.1.0-dev.1 is working better for you? @abdelaziz-mahdy

abdelaziz-mahdy commented 2 weeks ago

I have made some changes which definitely improves the performance to 10 or more frames. Can you try if version 5.1.0-dev.1 is working better for you? @abdelaziz-mahdy

Oh okay will try that and let you know, thank you

abdelaziz-mahdy commented 2 weeks ago

nice i see no more full widget rerender on scrolling so all good in that version, thats awesome thank you <3

edit: btw this is how i caught it in the first time https://docs.flutter.dev/tools/devtools/inspector#highlight-repaints

and the stutter will be there for me due to loading alot of images but now after the first render no more stutters while scrolling hopefully.

karvulf commented 2 weeks ago

That's good to know, thank you for the link. :) I just published version 5.1.0 which contains the improvement. If there is something else not working like expected, you can open another issue. Thank you for your support!

abdelaziz-mahdy commented 2 weeks ago

thank you for the awesome package and your help <3