响应式屏幕抖动:如何设置 base_width?

问题描述 投票:0回答:0

Image of the app and code 我正在尝试对屏幕尺寸颤振应用程序进行响应,但是屏幕尺寸溢出了。

我从 figma 设计中下载了函数 12 的代码,我做了一些更改,但我不知道如何根据设备获得基本宽度,因此 fem 计算正确。非常感谢。

class _ScheduleState extends State<Schedule> {
  @override
  Widget build(BuildContext context) {
    double baseWidth = 380;
    double fem = MediaQuery.of(context).size.width / baseWidth;
    double ffem = fem * 0.97;
android ios flutter dart screen-size
© www.soinside.com 2019 - 2024. All rights reserved.