Flutter :- Create circular border around icons
I am doing some mistakes in my above code. but I have figured out and here is the new code.
Container(
margin: EdgeInsets.all(20),
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
border: Border.all(width: 2, color: Colors.white)),
child: Icon(
Icons.cancel,
color: Colors.white,
),
)),
Also if you want to make complete Widget clickable then you can use it like this.
GestureDetector(
onTap: () {
//Navigator.of(context).pop();
},
child: new Align(
alignment: Alignment.bottomRight,
child: Container(
margin: EdgeInsets.all(20),
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
border: Border.all(width: 2, color: Colors.white)),
child: Icon(
Icons.cancel,
color: Colors.white,
),
)),
),
Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
border: Border.all(color: Colors.white)
),
child: Icon(Icons.check, color: Colors.white,),
)
or you can use Material if you're going to need some fancy effects:
Material(
color: Colors.transparent,
shape: CircleBorder(
side: BorderSide(color: Colors.white)
),
child: Icon(Icons.check, color: Colors.white,),
)