Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Is there any way to change Flutter icons "secondary" color?

I am using Icons.verified in flutter and I can change the background color fine, but cannot change the inner tick color.
Any way to do that ?

const verifiedBadge = Icon(
  Icons.verified,
  color: Color(0xFF27aae1),
  size: 28,
);

I looked into the available properties but do not see any secondary, highlightColor or something that might get the job done.

If I can’t do this with the Icons any other way to achieve it ?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

PS: I tried a stack in which i used the component above and a tick trying to cover the tick and use new color but looked ugly

>Solution :

There aren’t any direct option to resolve this.
You may try putting it in a stack and place a coloured container below the icon instead putting it on the top

    Stack(
        children: [
          Positioned.fill(
            child: Align(
              alignment: Alignment.center,
              child: Container(
                width: 20,
                decoration: const BoxDecoration(
                  color: Colors.yellow,
                  shape: BoxShape.circle,
                ),
              ),
            ),
          ),
          Icon(
            Icons.verified,
            color: Color(0xFF27aae1),
            size: 38,
          ),
        ],
      ),
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading