【发布时间】:2017-05-24 07:48:05
【问题描述】:
假设您有一个可能具有可变大小的父小部件。
例如:
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 中最好的方法是什么?
【问题讨论】:
-
flutter wiki 引用了几种方法来做到这一点:github.com/flutter/flutter/wiki/Creating-Responsive-Apps
标签: flutter dart flutter-layout flutter-widget