[英]How to create background gradient effect in Flutter same as Apple TV app
您可以使用container
BoxDecoration
boxShadow
来实现这一点。 这是一个例子
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
height: 200,
width: 200,
child: Card(
child: Center(
child: Icon(
Icons.movie,
size: 150.0,
),
),
),
decoration: BoxDecoration(boxShadow: [
BoxShadow(
color: Colors.white54,
blurRadius: 10.0,
offset: Offset(0, 10),
spreadRadius: 0.5,
),
]),
);
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.