skip to Main Content

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

Answers


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

    fillColor: MaterialStateProperty.all(Colors.black),
    
    Login or Signup to reply.
  2. 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);
                  },
                ),
    
    Login or Signup to reply.
  3. checkColor: Colors.red,
    

    You can change the color with this.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search