Change checked mark color of checkbox in flutter
Right now I am Using -
Flutter (Channel dev, v1.2.2,)
Option to change the Checkmark Color is not present on stable channel.
Checkbox(
value: isCheck,
checkColor: Colors.yellowAccent, // color of tick Mark
activeColor: Colors.grey,
onChanged: (bool value) {
setState(() {
isCheck = value;
});
}),
To change color of a checkbox:
When inactive (border color):
Theme(
data: Theme.of(context).copyWith(
unselectedWidgetColor: Colors.white,
),
child: Checkbox(...),
)
When checked (icon color):
Checkbox(
checkColor: Colors.red,
...
)
When active (checked):
Checkbox(
activeColor: Colors.amberAccent,
...
)
Full Code Sample:
Theme(
data: Theme.of(context).copyWith(
unselectedWidgetColor: Colors.white,
),
child: Checkbox(
checkColor: Colors.red,
activeColor: Colors.amberAccent,
value: _terms,
onChanged: (bool value) {
setState(() {
_terms = value;
});
},
),
)