可折叠设备UI,折叠和展开状态

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

有什么方法可以在折叠状态或展开状态下从可折叠设备获取用户屏幕状态,我尝试做了一些研究,发现了这一点,

bool isFolded = screenWidth < 600 || screenHeight < 600;

但是如果我使用这个,并且将来如果有任何具有高质量分辨率的手机,它肯定会使用展开条件,对吧?有什么办法可以改变它吗?看起来像的东西

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('My Home Page'),
      ),
      body: Center(
        child: kIsWeb
            ? Text('This is the web version')
            : Text('This is the mobile version'),
      ),
    );
  }
}

它是为了检测我们是否在 flutter 中使用网络/移动版本,因为如果我使用可折叠设备 ui,并且我使用折叠条件下的正常 ui。设计看起来会很大。

这是展开状态

这就是折叠条件

flutter dart user-interface responsive-design
1个回答
0
投票

您可以使用微软的双屏库

© www.soinside.com 2019 - 2024. All rights reserved.