How to set background color for an icon button?

You can use a Circular Avatar with the radius = text field’s height/2 or whatever height you prefer.

To figure out text field specs you can visit material.io

So the chunk of code is going to be like the following:

CircleAvatar(
                radius: 30,
                backgroundColor: Color(0xff94d500),
                child: IconButton(
                  icon: Icon(
                    Icons.search,
                    color: Colors.black,
                  ),
                  onPressed: () {
                    ...
                  },
                ),
              ),

This way you get an Icon button with background color.
I hope this can help you guys.

Icon button with background

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)