Right now, the opacity of duotone icons uses the Opacity widget.
This can negatively impact performance, as this widget is relatively expensive. From Flutter's official performance best practices docs:
Instead of wrapping simple shapes or text in an Opacity widget, it's usually faster to just draw them with a semitransparent color.
Instead, it'd be preferable if either:
- the
duotoneSecondaryOpacity attribute was deprecated and the opacity was taken from the duotoneSecondaryColor only
- OR the
withValues(alpha: ...) value was used for the secondary icon color instead of the Opacity widget
I prefer the first option, as:
- it's much simpler to send just one value than two values
- it'd be consistent with the way the primary icon color works
- it'd be consistent with the way Flutter's Icon widget works
It would require deprecation of the duotoneSecondaryOpacity attribute and a major release where the default opacity would be 1 instead of 0.2.
Right now, the opacity of duotone icons uses the
Opacitywidget.This can negatively impact performance, as this widget is relatively expensive. From Flutter's official performance best practices docs:
Instead, it'd be preferable if either:
duotoneSecondaryOpacityattribute was deprecated and the opacity was taken from theduotoneSecondaryColoronlywithValues(alpha: ...)value was used for the secondary icon color instead of theOpacitywidgetI prefer the first option, as:
It would require deprecation of the
duotoneSecondaryOpacityattribute and a major release where the default opacity would be 1 instead of 0.2.