我试图实现一个效果,允许一个小部件覆盖另一个小部件
如此看到 这里
我目前的代码是这样的:
@override
Widget build(BuildContext context) {
Size screenSize = MediaQuery.of(context).size;
return new Column(children: <Widget>[
new Container(
color: Colors.blue,
height: screenSize.height / 2,
width: screenSize.width,
child: new Center(
child: new Container(
margin: const EdgeInsets.only(top: 320.0),
color: Colors.red,
height: 40.0,
width: 40.0,
),
))
]);
}
这导致了以下, 正方形被容器裁剪掉了。
有其他的解决办法吗?