Flutter 带有透明图标的剪辑容器

Flutter 带有透明图标的剪辑容器,flutter,Flutter,我想知道实现右下角圆形图标按钮效果的最佳方法是什么 请注意,图标是透明的,并显示图像背景。 我尝试使用堆栈小部件,但无法正确定位,也无法使颜色透明 目前我有: class Banner extends StatelessWidget { final String src; const Banner(this.src, {Key key}) : super(key: key); @override Widget build(BuildContext context) {

我想知道实现右下角圆形图标按钮效果的最佳方法是什么

请注意,图标是透明的,并显示图像背景。
我尝试使用
堆栈
小部件,但无法正确定位,也无法使颜色透明

目前我有:

class Banner extends StatelessWidget {
  final String src;

  const Banner(this.src, {Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return AspectRatio(
      aspectRatio: 16 / 9,
      child: Stack(children: <Widget>[
        Container(
          decoration: BoxDecoration(
            shape: BoxShape.circle,
            color: Colors.white,
          ),
          child: Stack(
            children: <Widget>[
              Image.network(src),
              LayoutBuilder(
                builder: (context, constraints) {
                  var calculatedOverlay = constraints.maxHeight / 3;
                  return Align(
                    alignment: Alignment.bottomRight,
                    child: Container(
                      decoration: BoxDecoration(
                        borderRadius: BorderRadius.only(
                          topLeft: Radius.circular(calculatedOverlay),
                        ),
                        color: Colors.white,
                      ),
                      height: calculatedOverlay,
                      width: calculatedOverlay,
                    ),
                  );
                },
              ),
            ],
          ),
        ),
        Material(
          type: MaterialType.transparency,
          child: InkWell(
            onTap: () {},
          ),
        ),
      ]),
    );
  }
}
类标题扩展了无状态小部件{
最终字符串src;
const Banner(this.src,{Key}):super(Key:Key);
@凌驾
小部件构建(构建上下文){
返回AspectRatio(
专题:16/9,
子:堆栈(子:[
容器(
装饰:盒子装饰(
形状:BoxShape.circle,
颜色:颜色,白色,
),
子:堆栈(
儿童:[
图像网络(src),
布局生成器(
生成器:(上下文、约束){
var calculatedOverlay=constraints.maxHeight/3;
返回对齐(
对齐:对齐。右下角,
子:容器(
装饰:盒子装饰(
borderRadius:仅限borderRadius(
左上角:半径。圆形(计算过的覆盖),
),
颜色:颜色,白色,
),
高度:计算高度,
宽度:计算过宽,
),
);
},
),
],
),
),
材料(
类型:MaterialType.transparency,
孩子:InkWell(
onTap:(){},
),
),
]),
);
}
}
其结果是:


提前谢谢。

你为什么不创建一个代表白色区域的图像,上面有透明区域?只需使用Photoshop。。。