flutter实现圆角阴影,如下图
直接上代码
class _MyShadow extends State {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
body: Container(
width: 200,
height: 100,
alignment: Alignment.center,
margin: EdgeInsets.only(left: 80, right: 80, top: 200, bottom: 18),
decoration: BoxDecoration(
color: Colors.white, // 底色
boxShadow: [
BoxShadow(
blurRadius: 10, //阴影范围
spreadRadius: 1, //阴影浓度
color: Color(0xFFF7F7F7), //阴影颜色
),
],
borderRadius: BorderRadius.circular(19),
//borderRadius: BorderRadius.only(
// topRight: Radius.circular(10),
// bottomRight: Radius.circular(10)) //单独加某一边圆角
),
child: Text(
"测试数据",
style: TextStyle(fontSize: 25, color: Colors.blue),
),
),
);
}
}