如何将容器的不透明度放在颤动中 [英] How to put opacity for container in flutter
本文介绍了如何将容器的不透明度放在颤动中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想为包含十六进制颜色代码的容器设置不透明度.我是新来的.请帮我.这是代码.提前致谢.
I want to put opacity for container which contain hexadecimal color code. I am new to flutter. Please help me. Here is the code. Thanks in advance.
final body = Container(
width: MediaQuery.of(context).size.width,
margin: const EdgeInsets.only(left: 40.0, right: 40.0),
padding: EdgeInsets.all(28.0),
decoration: new BoxDecoration(
color: const Color(0xFF0E3311),//here i want to add opacity
border: new Border.all(color: Colors.black54,
),
borderRadius: new BorderRadius.only(
topLeft: const Radius.circular(40.0),
topRight: const Radius.circular(40.0),
bottomLeft: const Radius.circular(40.0),
bottomRight:const Radius.circular(40.0) )
),
child: Column(
children: <Widget>[ email, password,loginButton],
),
);
推荐答案
换行
const Color(0xFF0E3311)
到
const Color(0xFF0E3311).withOpacity(0.5)
或任何你想要的值.
这篇关于如何将容器的不透明度放在颤动中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文