【发布时间】:2019-02-16 10:43:01
【问题描述】:
我有一个简单的颤振设置来获取分辨率为 2960*1440 的设备上的屏幕宽度。
但是,当我以 2960*1440 分辨率运行应用程序时,flutter 返回的屏幕宽度为 411。 Flutter 如何计算设备的宽度?
class page extends StatelessWidget {
@override
Widget build(BuildContext context) {
final width = MediaQuery.of(context).size.width.toString();
return Container(
child: Text("Height : $height and Width : $width"),
);
}
}
【问题讨论】:
标签: flutter