flutter 给小部件加圆角
报错:Cannot provide both a color and a decoration The color argument is just a shorthand for "decoration: new BoxDecoration(color: color)".
错误代码
child: Container(
height: 40,
color: Colors.white,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.0),
color: Colors.white,
),
![报错表述的意思是不能同时提供颜色和装饰.png](https://upload-images.jianshu.io/upload_images/1949959-eae7638fb30ca1af.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
解决办法去掉:只能去掉上面的
child: Container(
height: 40,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.0),
color: Colors.white,
),