Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用MediaQuery.of(context).size.width获取的屏幕宽度,实际展示的宽度不到屏幕的一半 #24

Open
zzzhhhhh001 opened this issue Mar 21, 2023 · 1 comment

Comments

@zzzhhhhh001
Copy link

final double screenHeight = MediaQuery.of(context).size.height;
final double screenWidth = MediaQuery.of(context).size.width;
print("screenHeightscreenHeight:$screenHeight");
print("screenWidthscreenWidth:$screenWidth");
android_window.open(
size: Size(screenWidth, 600),
position: Offset(100, 1500),
);

用的上面的代码,高度获取是900多,宽度是411

@zzzhhhhh001
Copy link
Author

Screenshot_2023-03-21-16-41-32-903_com kk flutter_kk
图中,倒数第二个按钮是用获取的屏幕宽度,悬浮窗也是用的屏幕宽度,差距好大

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant