rydmike / flex_color_picker

A highly customizable Flutter color picker.
BSD 3-Clause "New" or "Revised" License
197 stars 41 forks source link

Improve performance of wheel picker #29

Closed krista-koivisto closed 3 years ago

krista-koivisto commented 3 years ago

Thank you for creating this color picker! It does everything I need and then some. 😊

I did improve the performance of the wheel picker some by splitting it up into separate CustomPainter widgets and introducing RepaintBoundary widgets around the more expensive painters. I also improved the shouldRepaint implementations for each custom painter widget so as to only repaint when relevant changes have happened.

The improvement I got was from ~18.5 FPS previously to ~120 FPS after changes in profile mode on my test device (mid-range Android phone from 2019.)

rydmike commented 3 years ago

Just wow, thanks @krista-koivisto for your contribution, this is great stuff!

I will review and test it tonight. Based on a quick code review it all looks excellent, so assuming it all checks out in the tests too, I will merge and release a new version tonight. I will let you know if I have any additional questions or comments.

rydmike commented 3 years ago

@krista-koivisto this is now merged and included in pub.dev released version 2.1.2. https://pub.dev/packages/flex_color_picker/changelog Thanks again for your fabulous contribution! 😃

krista-koivisto commented 3 years ago

I see you put a contribution in the changelog as well. That was not necessary, but I do appreciate it. Thank you! :smiley:

rydmike commented 3 years ago

It was a really nice improvement. I had been thinking of splitting up the painting into two parts as well, this did it beautifully and more. One less thing I had to look into. Really nice to get contributions like this.

I would have tagged you on Twitter in my release Tweet as well, but I was not sure if you are active on Twitter as a Flutter developer, or at all.

https://twitter.com/rydmike/status/1416139130757582856?s=21

I don't use social media so much otherwise, but the Flutter / FlutterDev bubble on Twitter is generally quite nice and welcoming, as well as often very useful.