OpenFlutter / flutter_screenutil

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

version 5.8.0 app not run please fix error #474

Closed pragneshpalsanabitcoding closed 1 year ago

jack24254029 commented 1 year ago
.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));
                          ^^^^^^^^
❯ flutter doctor -v               
[✓] Flutter (Channel stable, 3.7.12, on macOS 13.3.1 22E772610a darwin-x64, locale zh-Hant-TW)
    • Flutter version 3.7.12 on channel stable at /Users/.../.development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 4d9e56e694 (3 weeks ago), 2023-04-17 21:47:46 -0400
    • Engine revision 1a65d409c7
    • Dart version 2.19.6
    • DevTools version 2.20.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at /Users/.../Library/Android/sdk
    • Platform android-33, build-tools 33.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18

[✓] Android Studio (version 2022.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] HTTP Host Availability
    • All required HTTP hosts are available
WanNurAdila commented 1 year ago

I've fixed it with updated my flutter to 3.10.0 if anyone wanna quick fix. Can't wait for the dev to fix it as I has a deployment later today.

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
lizhuoyuan commented 1 year ago

use 5.7.0.

5.8.0 need flutter 3.10

mufarrah commented 1 year ago

I've fixed it with updated my flutter to 3.10.0 if anyone wanna quick fix. Can't wait for the dev to fix it as I has a deployment later today.

mee too , thanks for the comment .. it helped