一般来说,您 永远 都 不要 在抖动中溢出。
如果需要特定的布局,则需要在不同的层上显式分离“溢出”窗口小部件。
一种解决方案是
Stack小部件,它允许小部件位于彼此之上。
最终实现这一目标:
颤动的代码将是
new Stack( fit: StackFit.expand, children: <Widget>[ new Column( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.stretch, children: <Widget>[ new Expanded( child: new Container( color: Colors.blue, ), ), new Expanded( child: new Container( color: Colors.white, ), ), ], ), new Center( child: new Container( color: Colors.red, height: 40.0, width: 40.0, ), ) ],);
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)