6
假設您有一個可能具有可變大小的父窗口小部件。如何根據父級的大小來佈置小部件?
例如:
var container = new Container(
height: 200.0, // Imagine this might change
width: 200.0, // Imagine this might change
// Imagine content in this container will
// depend on the parent container
child: new Container(),
);
也許你想擁有父容器的孩子呈現一些基於大小,它給了什麼不同。
想到響應式設計斷點,如果寬度超過X使用此佈局,如果寬度在X下使用該佈局。
在Flutter中做到這一點的最佳方法是什麼?
撲克wiki引用了一些方法來執行此操作:https://github.com/flutter/flutter/wiki/Creating-Responsive-Apps – Aaron