dnfield / flutter_svg

SVG parsing, rendering, and widget library for Flutter
MIT License
1.64k stars 449 forks source link

[PERFORMANCE] ColorFilter introduces jank #1071

Closed tofylion closed 4 weeks ago

tofylion commented 1 month ago

When working with SVGs, even pre-compiled ones, ColorFilter introduces a lot of jank. Especially when used multiple times in a list.

Here's how my color filter is configured:

colorFilter: ColorFilter.mode(
              !widget.bookmarked ? _secondaryColor : _primaryColor,
              BlendMode.srcIn),

This is especially a problem when needing to switch between light/dark modes, etc...

jonahwilliams commented 4 weeks ago

If you use a filter you have to pay the cost. The flutter repo has an issue template for perfomance problems. If you fill it out and include an example application, we could benchmark and determine if there is anything that can be done.

This isn't directly related to flutter_svg