flutter(十七)Flutter Stack 帧布局,层叠堆放

343 阅读1分钟
原文链接: blog.csdn.net

Flutter Stack 帧布局,层叠堆放

两个Image堆放在一起


new Stack(
              children: <Widget>[
                new Image(
                  image: imageUrl,
                  width: 300.0,
                  height: 200.0,
                  fit: BoxFit.cover,
                ),
                //控制位置
                new Positioned(
                  right: 15.0,
                  top: 15.0,
                  child: new Icon(
                    Icons.share,
                    color: Colors.white,
                  ),
                ),
              ],
            )