OpenFlutter / flutter_screenutil

Flutter screen adaptation, font adaptation, get screen information
https://pub.dartlang.org/packages/flutter_screenutil
Apache License 2.0
3.85k stars 486 forks source link

Error (Xcode): ../../.pub-cache/hosted/pub.dev/flutter_screenutil-5.8.0/lib/src/screen_util.dart:62:59: Error: The getter 'implicitView' isn't defined for the class 'PlatformDispatcher'. #476

Closed Amoour closed 1 year ago

Amoour commented 1 year ago

Error (Xcode): ../../.pub-cache/hosted/pub.dev/flutter_screenutil-5.8.0/lib/src/screen_util.dart:62:59: Error: The getter 'implicitView' isn't defined for the class 'PlatformDispatcher'.

lowapple commented 1 year ago

Same Issue

../../../.pub-cache/hosted/pub.dev/flutter_screenutil-5.8.0/lib/src/screen_util.dart:62:59: Error: The getter 'implicitView' isn't defined for the class 'PlatformDispatcher'.
 - 'PlatformDispatcher' is from 'dart:ui'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'implicitView'.
    window ??= WidgetsBinding.instance.platformDispatcher.implicitView;
                                                          ^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dev/flutter_screenutil-5.8.0/lib/src/screenutil_init.dart:81:27: Error: Member not found: 'MediaQueryData.fromView'.
    return MediaQueryData.fromView(View.of(context));
                          ^^^^^^^^
Target kernel_snapshot failed: Exception
lowapple commented 1 year ago

You can work around this with a temporary fix. Just put in the version you're currently using, and build.

dependency_overrides:
  flutter_screenutil: 5.6.0
Amoour commented 1 year ago
image

It doesn't work for me. thank you

lizhuoyuan commented 1 year ago

plz use 5.7.0 , will fix