Showing
2 changed files
with
3 additions
and
3 deletions
@@ -59,9 +59,9 @@ class ScreenUtil { | @@ -59,9 +59,9 @@ class ScreenUtil { | ||
59 | Duration duration = const Duration(milliseconds: 10), | 59 | Duration duration = const Duration(milliseconds: 10), |
60 | ]) async { | 60 | ]) async { |
61 | final binding = WidgetsFlutterBinding.ensureInitialized(); | 61 | final binding = WidgetsFlutterBinding.ensureInitialized(); |
62 | - window ??= binding.window; | 62 | + window ??= WidgetsBinding.instance.platformDispatcher.implicitView; |
63 | 63 | ||
64 | - if (window.physicalGeometry.isEmpty) { | 64 | + if (window?.physicalGeometry.isEmpty == true) { |
65 | return Future.delayed(duration, () async { | 65 | return Future.delayed(duration, () async { |
66 | binding.deferFirstFrame(); | 66 | binding.deferFirstFrame(); |
67 | await ensureScreenSize(window, duration); | 67 | await ensureScreenSize(window, duration); |
@@ -78,7 +78,7 @@ class _ScreenUtilInitState extends State<ScreenUtilInit> | @@ -78,7 +78,7 @@ class _ScreenUtilInitState extends State<ScreenUtilInit> | ||
78 | } | 78 | } |
79 | } | 79 | } |
80 | 80 | ||
81 | - return MediaQueryData.fromWindow(binding.window); | 81 | + return MediaQueryData.fromView(View.of(context)); |
82 | } | 82 | } |
83 | 83 | ||
84 | Widget get child { | 84 | Widget get child { |
-
Please register or login to post a comment