Flutter UI - Decoration 、shape(1),如何才能通过一线互联网公司面试

color: Colors.redAccent,

offset: Offset(20, 20),

blurRadius: 10,

),

]

复制代码

上面的例子很难看,因为我们可能不知道阴影实际应该设置多大,这点可以参考官方文档的例子:

DecoratedBox(

decoration: BoxDecoration(

gradient: LinearGradient(colors:[Colors.red,Colors.orange[700]]), //背景渐变

borderRadius: BorderRadius.circular(3.0), //3像素圆角

boxShadow: [ //阴影

BoxShadow(

color:Colors.black54,

offset: Offset(2.0,2.0),

blurRadius: 4.0

)

]

),

child: Padding(padding: EdgeInsets.symmetric(horizontal: 80.0, vertical: 18.0),

child: Text(“Login”, style: TextStyle(color: Colors.white),),

)

)

复制代码


gradient 渐变

这部分和 android

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值