Remove deprecated call to .window

This commit is contained in:
Shawn 2023-04-27 10:35:57 -06:00
parent c50cecded3
commit 253c6b2075

View File

@ -12,7 +12,7 @@ class PlatformInfo {
static bool get isDesktopOrWeb => isDesktop || kIsWeb; static bool get isDesktopOrWeb => isDesktop || kIsWeb;
static bool get isMobile => _mobilePlatforms.contains(defaultTargetPlatform) && !kIsWeb; static bool get isMobile => _mobilePlatforms.contains(defaultTargetPlatform) && !kIsWeb;
static double get pixelRatio => WidgetsBinding.instance.window.devicePixelRatio; static double get pixelRatio => WidgetsBinding.instance.platformDispatcher.views.first.devicePixelRatio;
static bool get isWindows => defaultTargetPlatform == TargetPlatform.windows; static bool get isWindows => defaultTargetPlatform == TargetPlatform.windows;
static bool get isLinux => defaultTargetPlatform == TargetPlatform.linux; static bool get isLinux => defaultTargetPlatform == TargetPlatform.linux;