You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// 仅支持纵屏。 /// returns the size after adaptation according to the screen width.(unit dp or pt) /// 返回根据屏幕宽适配后尺寸(单位 dp or pt) /// size 单位 dp or ptdoublegetWidth(double size) {
return _screenWidth ==0.0? size : (size * _screenWidth / _designW);
}
/// 仅支持纵屏。 /// returns the size after adaptation according to the screen height.(unit dp or pt) /// 返回根据屏幕高适配后尺寸(单位 dp or pt) /// size unit dp or ptdoublegetHeight(double size) {
return _screenHeight ==0.0? size : (size * _screenHeight / _designH);
}
你好,我使用ScreenUtil来作为产品的自适应方案。我希望在折叠屏设备折叠状态发生变化的时候,能自动更新页面UI元素尺寸。
当前情况:
使用如下方法,需要手动setState()或调用MediaQuery.of(context)才能实现。
其中,ScreenUtil中的某些方法中,包含执行MediaQuery.of(context)逻辑,可以实现自动刷新
请问第一种情况是否有办法解决,还是只能手动setState来实现自动更新?
The text was updated successfully, but these errors were encountered: