导入 import 'dart:ui';
1.获取 window.platformBrightness 的值 如果是 Brightness.light 代表是正常模式, 如果是Brightness.dark代表是暗黑模式
2.获取屏幕宽高
final double screenWidth = window.physicalSize.width/window.devicePixelRatio;
final double screenHeight = window.physicalSize.height/window.devicePixelRatio;
网友评论