Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Method 'addPostFrameCallback' #81

Closed
xiaochenghua opened this issue Jul 18, 2022 · 4 comments
Closed

Error: Method 'addPostFrameCallback' #81

xiaochenghua opened this issue Jul 18, 2022 · 4 comments

Comments

@xiaochenghua
Copy link

../../../../.pub-cache/hosted/pub.dartlang.org/another_flushbar-1.10.29/lib/flushbar.dart:350:31: Error: Method 'addPostFrameCallback'
cannot be called on 'SchedulerBinding?' because it is potentially null.

@xiaochenghua
Copy link
Author

➜ ~ flutter doctor -v
[✓] Flutter (Channel stable, 2.10.2, on macOS 12.4 21F79 darwin-x64, locale zh-Hans-CN)
• Flutter version 2.10.2 at /Users/chenghua/fvm/versions/2.10.2
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 097d3313d8 (5 months ago), 2022-02-18 19:33:08 -0600
• Engine revision a83ed0e5e3
• Dart version 2.16.1
• DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/chenghua/Library/Android/sdk
• Platform android-31, build-tools 31.0.0
• ANDROID_HOME = /Users/chenghua/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.2

[✓] Android Studio (version 2021.1)
• 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 11.0.11+0-b60-7590822)

[✓] VS Code (version 1.69.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.44.0

[✓] Connected device (1 available)
• iPhone 13 (mobile) • DCFCD6AF-9B56-4285-82C6-03268E02C309 • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-0 (simulator)

[✓] HTTP Host Availability
• All required HTTP hosts are available

• No issues found!

@Kuri-Tai
Copy link

Kuri-Tai commented Jul 26, 2022

I have changed pubspec.yaml, then ran flutter clean and flutter pub get. It worked.

...
# another_flushbar: ^1.10.29 # before
another_flushbar: 1.10.28 # after 
# or
another_flushbar: <=1.10.28 # etc.

22c5470#diff-31c0a3f2a09ed06c40eaf4a0ef3a079e92097ac3779f18028d73ced2e457b45a

I guess this commit has changed the relevant code, then it started getting errors with Flutter which versions under 3.0.0.

@Kuri-Tai
Copy link

Kuri-Tai commented Jul 26, 2022

I propose to add a constraint on the version of Flutter in pubspec.yaml as follows,

environment:
  sdk: ...
  flutter: '>=3.0.0'

@cmdrootaccess cmdrootaccess pinned this issue Aug 29, 2022
@cmdrootaccess
Copy link
Owner

Please upgrade to flutter 3 and this issue will be resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants