child: Text(“BoxShadow(绘制阴影)+Container+BoxDecoration”),
));
}
}
阴影(BoxShadow)+X轴偏移量(Offset)
class _MyHomePageState extends State {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Container(
padding: EdgeInsets.all(20.0),
margin: EdgeInsets.all(20.0),
decoration: new BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(10.0)),
border: new Border.all(width: 1, color: Colors.black,),
boxShadow: [
BoxShadow(
color: Colors.black,
offset: Offset(6.0, 0.0), //阴影x轴偏移量
blurRadius: 0, //阴影模糊程度
spreadRadius: 0 //阴影扩散程度
)
],
),
child: Text(“BoxShadow(绘制阴影)+Container+BoxDecoration”),
));
}
}
阴影(BoxShadow)+XY轴偏移量(Offset)