Flutter CheckboxListTile icon border color change

311 views Asked by At

In flutter, CheckboxListTile widget ,i can't change this default color. How can I change it to my desire color. enter image description here

I want ti customized this border color, how can i chane the border color. I only see the parameters of Checkcolor and some others that can't change default border color?

3

There are 3 answers

0
Munsif Ali On BEST ANSWER

you can use fillColor property for this output which takes MaterialStateProperty like bellow:

fillColor: MaterialStateProperty.all(Colors.black),
0
Krish Bhanushali On

According to the documentation CheckboxListTile has a side property that simply accepts BorderSide you can use to change its color

Example from here:

CheckboxListTile(side: BorderSide(color:Colors.red) .... 

side → BorderSide? The color and width of the checkbox's border.

You can also change color based on state.

side: MaterialStateBorderSide.resolveWith(
              (Set<MaterialState> states) {
                if (states.contains(MaterialState.selected)) {
                  return const BorderSide(color: Colors.red);
                }
                return const BorderSide(color: Colors.green);
              },
            ),
0
lalit patidar On
checkColor: Colors.red,

You can change the color with this.