我需要制作一个带有圆角边框、颜色和轮廓的容器,但是背景颜色溢出了轮廓颜色。如何解决这个问题?
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
height: 21,
constraints: BoxConstraints(
minWidth: 21,
),
decoration: BoxDecoration(
border: Border.all(color: Colors.white, width: 2),
borderRadius: BorderRadius.circular(21),
color: Colors.pink,
),
child: Align(
child: Text(
"1",
style: TextStyle(
color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12),
)));
}
}
结果:(最明显的在左边)