You can use the ClipRRect
widget:
Scaffold(
body: Padding(
padding: EdgeInsets.all(8.0),
child: Row(
children: [
ClipRRect(
borderRadius: BorderRadius.circular(20),
child: Container(
width: 100,
color: Colors.red,
child: Text(
'Healthy',
textAlign: TextAlign.center,
style: TextStyle(color: Colors.white),
),
),
),
SizedBox(
width: 10,
),
ClipRRect(
borderRadius: BorderRadius.circular(20),
child: Container(
width: 100,
color: Colors.red,
child: Text(
'Healthy',
textAlign: TextAlign.center,
style: TextStyle(color: Colors.white),
),
),
),
],
),
),
);
Result:
Row(
children: [
//unselected Chip
ActionChip(
onPressed: (){
},
shape: StadiumBorder(side: BorderSide()),
label: Text("History"),
backgroundColor: Colors.white,
),
//selected Chip
ActionChip(
onPressed: (){
},
label: Text("Funny Stories"),
shape: StadiumBorder(side: BorderSide(color: Colors.orange)),
backgroundColor: Colors.orange,
)
],
),
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.