相关疑难解决方法(0)

如何根据父级的大小布局小部件?

假设您有一个可能具有可变大小的父窗口小部件.

例如:

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(), 
);
Run Code Online (Sandbox Code Playgroud)

也许你想让父容器的子进程根据它给出的大小来呈现不同的东西.

想想响应式设计断点,如果宽度超过X则使用此布局,如果宽度在X下使用该布局.

在Flutter中做到这一点的最佳方法是什么?

dart flutter

34
推荐指数
4
解决办法
1万
查看次数

标签 统计

dart ×1

flutter ×1