如何在容器中放置不透明度 [英] How to put opacity for container in flutter

查看:76
本文介绍了如何在容器中放置不透明度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为包含十六进制颜色代码的容器添加不透明度.我是新来的扑扑.请帮我.这是代码.预先感谢.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆