如何说出带有阴影的容器(如所附图片)?
我不只是使用图像,因为要对其进行微小的更改会更加困难,并且颜色有时需要是整个屏幕的宽度,也许我要对其进行动画处理。 / p>
答案 0 :(得分:3)
class Gradiant extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
decoration: new BoxDecoration(
gradient: new LinearGradient(
colors: [Colors.blue[800], Colors.purple, Colors.red],
begin: Alignment.bottomCenter,
end: Alignment.topCenter,
stops: [0.2, 0.6, 1]),
),
),
);
}
}
答案 1 :(得分:1)