Flutter 如何在flatter中向eclipse容器添加不透明度,如下所示?
不透明 无不透明 我想将我的容器转换为不透明度,如上图所示。怎么做 以下是我的容器代码:Flutter 如何在flatter中向eclipse容器添加不透明度,如下所示?,flutter,dart,flutter-layout,Flutter,Dart,Flutter Layout,不透明 无不透明 我想将我的容器转换为不透明度,如上图所示。怎么做 以下是我的容器代码: Positioned( bottom: 0, child: Arc( arcType: ArcType.CONVEX, edge: Edge.TOP, height: 60.0, child: Opacity( opacity: 1, child: new Container( height: 140, wi
Positioned(
bottom: 0,
child: Arc(
arcType: ArcType.CONVEX,
edge: Edge.TOP,
height: 60.0,
child: Opacity(
opacity: 1,
child: new Container(
height: 140,
width: MediaQuery.of(context).size.width,
color: Colors.white.withOpacity(0.8),
),
),
),
),
添加行
const Color(0xFF0E3311).withOpacity(0.5)
Container(
decoration: new BoxDecoration(
color: const Color(0xFF0E3311).withOpacity(0.5),
),
),
添加行
const Color(0xFF0E3311).withOpacity(0.5)
Container(
decoration: new BoxDecoration(
color: const Color(0xFF0E3311).withOpacity(0.5),
),
),
您需要的是backdropfilter:
Positioned(
bottom: 0,
child: Arc(
arcType: ArcType.CONVEX,
edge: Edge.TOP,
height: 60.0,
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
child: Container(
height: 140,
width: MediaQuery.of(context).size.width,
color: Colors. black.withOpacity(0),
),
),
),
),
您需要的是backdropfilter:
Positioned(
bottom: 0,
child: Arc(
arcType: ArcType.CONVEX,
edge: Edge.TOP,
height: 60.0,
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
child: Container(
height: 140,
width: MediaQuery.of(context).size.width,
color: Colors. black.withOpacity(0),
),
),
),
),
您可以使用
BackdropFilter
小部件包装您的容器,这样BackdropFilter小部件将接受一个子项和筛选值。在这里你可以得到更多的信息
如果你想用BackdropFilter小部件包装你的容器,你应该这样做:
定位(
底部:0,
儿童:Arc(
arcType:arcType.凸面,
edge:edge.TOP,
身高:60.0,
孩子:背投滤波器(
过滤器:ImageFilter.blur(sigmaX:3,sigmaY:5),
子:容器(
身高:140,
宽度:MediaQuery.of(context).size.width,
颜色:颜色。黑色。不透明度(0),
),
),
),
),
您可以使用BackdropFilter
小部件包装您的容器,这样BackdropFilter小部件将接受一个子项和筛选值。在这里你可以得到更多的信息
如果你想用BackdropFilter小部件包装你的容器,你应该这样做:
定位(
底部:0,
儿童:Arc(
arcType:arcType.凸面,
edge:edge.TOP,
身高:60.0,
孩子:背投滤波器(
过滤器:ImageFilter.blur(sigmaX:3,sigmaY:5),
子:容器(
身高:140,
宽度:MediaQuery.of(context).size.width,
颜色:颜色。黑色。不透明度(0),
),
),
),
),
他要找的是高斯模糊。如果你在寻找性能更好的不透明度,只需使用“不透明度”小部件或.withAlpha而不是.WithOpacity即可。他想要的是高斯模糊。如果您正在寻找性能更好的不透明度,只需使用不透明度小部件或.withAlpha而不是.withOpacity