Showing
1 changed file
with
1 additions
and
1 deletions
@@ -101,7 +101,7 @@ class ScreenUtil { | @@ -101,7 +101,7 @@ class ScreenUtil { | ||
101 | 101 | ||
102 | final initCompleter = Completer<void>(); | 102 | final initCompleter = Completer<void>(); |
103 | 103 | ||
104 | - WidgetsBinding.instance.addPostFrameCallback((_) { | 104 | + WidgetsFlutterBinding.ensureInitialized().addPostFrameCallback((_) { |
105 | mediaQueryContext?.visitChildElements((el) => _instance._context = el); | 105 | mediaQueryContext?.visitChildElements((el) => _instance._context = el); |
106 | if (_instance._context != null) initCompleter.complete(); | 106 | if (_instance._context != null) initCompleter.complete(); |
107 | }); | 107 | }); |
-
Please register or login to post a comment