diff --git a/lib/src/core/context.dart b/lib/src/core/context.dart index 6b62c84..20f9f3c 100644 --- a/lib/src/core/context.dart +++ b/lib/src/core/context.dart @@ -24,11 +24,15 @@ class ZKContext { } double get screenWidth { - return ui.window.physicalSize.width; + // https://stackoverflow.com/questions/76312328/flutter-3-10-window-is-deprecated-and-shouldnt-be-used + return WidgetsBinding + .instance.platformDispatcher.views.first.physicalSize.width; } double get screenHeight { - return ui.window.physicalSize.height; + // ui.window.physicalSize + return WidgetsBinding + .instance.platformDispatcher.views.first.physicalSize.height; } double get appWidth { diff --git a/pubspec.yaml b/pubspec.yaml index a1d1a0a..7edf228 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: Zerker is a flexible and lightweight flutter canvas graphic animati # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 2.2.6 +version: 2.3.1 homepage: https://github.com/flutterkit/zerker environment: