Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change checkbox border-color in flutter? By default, it is showing black but I want it in grey

Tags:

flutter

dart

How to change checkbox border-color in flutter? By default, it is showing black but I want it in grey.

like image 404
Aishwarya Avatar asked Jan 08 '20 17:01

Aishwarya


People also ask

How do you change the border outline color in flutter?

You can change TextField border color in Flutter, by adding style to the TextField widget. Basically, you provide the styling instructions by using the InputDecoration widget.

How do you change the border thickness in flutter?

To change the color and width of Container's border, use its decoration property. Set decoration property with BoxDecoration() object. Set the border property of BoxDecoration() object, with required color and width as per your applications specifications.


1 Answers

Use this:

Checkbox(
  shape: RoundedRectangleBorder(
    borderRadius: BorderRadius.circular(2.0),
  ),
  side: MaterialStateBorderSide.resolveWith(
      (states) => BorderSide(width: 1.0, color: Colors.red),
  ),
),
like image 161
chuxyz Avatar answered Sep 27 '22 18:09

chuxyz