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

'WidgetsBinding' runtime warnings using 3.0.0 stable release #103561

Closed
pattobrien opened this issue May 12, 2022 · 73 comments
Closed

'WidgetsBinding' runtime warnings using 3.0.0 stable release #103561

pattobrien opened this issue May 12, 2022 · 73 comments
Labels
a: error message Error messages from the Flutter framework a: null-safety Support for the Dart's team new null safety feature customer: crowd Affects or could affect many people, though not necessarily a specific customer. framework flutter/packages/flutter repository. See also f: labels. P2 Important issues not at the top of the work list r: solved Issue is closed as solved

Comments

@pattobrien
Copy link

Pre-Requisites

  • Flutter installed with the latest 3.0.0 stable, using FVM version manager.

Steps to Reproduce

  1. Execute flutter create test_app to create a new app
  2. Execute flutter run to build and run app

Expected results:

No warnings in debug console.

Actual results:

The following warnings are seen:

 Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
../…/src/framework.dart:275
- 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../../fvm/versions/stable/packages/flutter/lib/src/scheduler/binding.dart').
package:flutter/…/scheduler/binding.dart:1
    if (SchedulerBinding.instance!.schedulerPhase ==
                         ^
: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
../…/src/widgets_binding_observer.dart:42
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../fvm/versions/stable/packages/flutter/lib/src/widgets/binding.dart').
package:flutter/…/widgets/binding.dart:1
    _state = WidgetsBinding.instance!.lifecycleState;
                            ^

: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
../…/src/widgets_binding_observer.dart:43
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../fvm/versions/stable/packages/flutter/lib/src/widgets/binding.dart').
package:flutter/…/widgets/binding.dart:1
    WidgetsBinding.instance!.addObserver(this);
                   ^
: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
../…/src/widgets_binding_observer.dart:52
Code sample
import 'package:flutter/material.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();

  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headline4,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ),
    );
  }
}
Logs
fvm flutter analyze
Analyzing custom_widgets_custom_themes...                       
No issues found! (ran in 0.9s)
[✓] Flutter (Channel stable, 3.0.0, on macOS 12.3.1 21E258 darwin-arm, locale en-US)
    • Flutter version 3.0.0 at /Users/pattobrien/fvm/versions/stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ee4e09cce0 (2 days ago), 2022-05-09 16:45:18 -0700
    • Engine revision d1b9a6938a
    • Dart version 2.17.0
    • DevTools version 2.12.2

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

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

[✓] 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-7772763)

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

[✓] Connected device (2 available)
    • iPhone 12 Pro (mobile) • 0296EE26-719D-4F1A-B59D-50FCB6EC3F7E • ios          • com.apple.CoreSimulator.SimRuntime.iOS-15-4
      (simulator)
    • macOS (desktop)        • macos                                • darwin-arm64 • macOS 12.3.1 21E258 darwin-arm

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

• No issues found!
@hiranlakshika
Copy link

@pattobrien Did you find any temp fix for this?

@meitesi
Copy link

meitesi commented May 12, 2022

The same problem was found

@ingmferrer
Copy link

same warnings for me

@pattobrien
Copy link
Author

@pattobrien Did you find any temp fix for this?

nope, no workaround found yet.

@maxlapides
Copy link

maxlapides commented May 12, 2022

You can just ignore these warnings for now :)

@darshankawar darshankawar added the in triage Presently being triaged by the triage team label May 12, 2022
@darshankawar
Copy link
Member

Can somebody try to run dart fix --apply and see if the warnings go away ?
Also, they seem to be warnings and may not be hampering the build flow. Probably this PR might be related #89451

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 12, 2022
@dkbast
Copy link

dkbast commented May 12, 2022

fixed them all in my code, but I get messages from dependencies which is quite annoying

@GitHelge
Copy link

GitHelge commented May 12, 2022

Ran dart fix --apply but it had nothing to fix because the problems are in community or other packages.

Can we somehow suppress the warnings in third party dependencies? - It makes logs unreadable on flutter test

@darshankawar
Copy link
Member

These warnings could also be the result of the fact that Flutter 3 introduces nullability changes to WidgetsBinding.

@ChrisElliotUK
Copy link

Can somebody try to run dart fix --apply and see if the warnings go away ? Also, they seem to be warnings and may not be hampering the build flow. Probably this PR might be related #89451

This fixed my issue from here: #103571 (comment)

@AnAlpaca
Copy link

This issue has NOT gone away for me after running dart fix --apply unfortunately. Below is the only thing that shows in my terminal as an error and not a warning.

`Error: The non-abstract class 'GaMaterialLocalizations' is missing implementations for these members:

  • MaterialLocalizations.keyboardKeyAlt
  • MaterialLocalizations.keyboardKeyAltGraph
  • MaterialLocalizations.keyboardKeyBackspace
  • MaterialLocalizations.keyboardKeyCapsLock
  • MaterialLocalizations.keyboardKeyChannelDown
  • MaterialLocalizations.keyboardKeyChannelUp
  • MaterialLocalizations.keyboardKeyControl
  • MaterialLocalizations.keyboardKeyDelete
  • MaterialLocalizations.keyboardKeyEisu
  • MaterialLocalizations.keyboardKeyEject
  • MaterialLocalizations.keyboardKeyEnd
  • MaterialLocalizations.keyboardKeyEscape
  • MaterialLocalizations.keyboardKeyFn
  • MaterialLocalizations.keyboardKeyHangulMode
  • MaterialLocalizations.keyboardKeyHanjaMode
  • MaterialLocalizations.keyboardKeyHankaku
  • MaterialLocalizations.keyboardKeyHiragana
  • MaterialLocalizations.keyboardKeyHiraganaKatakana
  • MaterialLocalizations.keyboardKeyHome
  • MaterialLocalizations.keyboardKeyInsert
  • MaterialLocalizations.keyboardKeyKanaMode
  • MaterialLocalizations.keyboardKeyKanjiMode
  • MaterialLocalizations.keyboardKeyKatakana
  • MaterialLocalizations.keyboardKeyMeta
  • MaterialLocalizations.keyboardKeyMetaMacOs
  • MaterialLocalizations.keyboardKeyMetaWindows
  • MaterialLocalizations.keyboardKeyNumLock
  • MaterialLocalizations.keyboardKeyNumpad0
  • MaterialLocalizations.keyboardKeyNumpad1
  • MaterialLocalizations.keyboardKeyNumpad2
  • MaterialLocalizations.keyboardKeyNumpad3
  • MaterialLocalizations.keyboardKeyNumpad4
  • MaterialLocalizations.keyboardKeyNumpad5
  • MaterialLocalizations.keyboardKeyNumpad6
  • MaterialLocalizations.keyboardKeyNumpad7
  • MaterialLocalizations.keyboardKeyNumpad8
  • MaterialLocalizations.keyboardKeyNumpad9
  • MaterialLocalizations.keyboardKeyNumpadAdd
  • MaterialLocalizations.keyboardKeyNumpadComma
  • MaterialLocalizations.keyboardKeyNumpadDecimal
  • MaterialLocalizations.keyboardKeyNumpadDivide
  • MaterialLocalizations.keyboardKeyNumpadEnter
  • MaterialLocalizations.keyboardKeyNumpadEqual
  • MaterialLocalizations.keyboardKeyNumpadMultiply
  • MaterialLocalizations.keyboardKeyNumpadParenLeft
  • MaterialLocalizations.keyboardKeyNumpadParenRight
  • MaterialLocalizations.keyboardKeyNumpadSubtract
  • MaterialLocalizations.keyboardKeyPageDown
  • MaterialLocalizations.keyboardKeyPageUp
  • MaterialLocalizations.keyboardKeyPower
  • MaterialLocalizations.keyboardKeyPowerOff
  • MaterialLocalizations.keyboardKeyPrintScreen
  • MaterialLocalizations.keyboardKeyRomaji
  • MaterialLocalizations.keyboardKeyScrollLock
  • MaterialLocalizations.keyboardKeySelect
  • MaterialLocalizations.keyboardKeySpace
  • MaterialLocalizations.keyboardKeyZenkaku
  • MaterialLocalizations.keyboardKeyZenkakuHankaku
    Try to either
  • provide an implementation,
  • inherit an implementation from a superclass or mixin,
  • mark the class as abstract, or
  • provide a 'noSuchMethod' implementation.`

@pranavo72bex
Copy link

pranavo72bex commented May 12, 2022

Facing same issue

dart fix --apply It wouldn't work for me.

@blue492
Copy link

blue492 commented May 12, 2022

This command NOT helped me dart fix --apply Android studion still show same warnings, and cant run the flutter app on it

@EvanJin
Copy link

EvanJin commented May 12, 2022

dart fix --apply It wouldn't work for me.

image

image

image

@darshankawar
Copy link
Member

Circling back on this issue, the warnings seems to be coming from framework itself and as mentioned earlier, could be related to #89451

If the warnings are coming from community plugins / packages, the fix need to be made in respective packages.

Based on the report and the traction received for this issue, I am going ahead and labeling it for further insights from the team.

/cc @Hixie

@darshankawar darshankawar added framework flutter/packages/flutter repository. See also f: labels. customer: crowd Affects or could affect many people, though not necessarily a specific customer. and removed waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds in triage Presently being triaged by the triage team labels May 12, 2022
@dev-thinks
Copy link

same for me as well. console is being clogged by these warnings.

@darshankawar darshankawar added a: error message Error messages from the Flutter framework a: null-safety Support for the Dart's team new null safety feature labels May 12, 2022
@mtrfnvwork
Copy link

+1

@blue492
Copy link

blue492 commented May 12, 2022

A temporary solution is downgrading: flutter downgrade v2.10.5

@hhajime
Copy link

hhajime commented May 14, 2022

dart fix --apply doesn't work.
Anyone fixed this issue, please answer here.

https://stackoverflow.com/questions/72210211/warning-operand-of-null-aware-operation-has-type-widgetsbinding-which-exc

thanks.

@hhajime
Copy link

hhajime commented May 14, 2022

if you are using device preview package.
check this. aloisdeniel/flutter_device_preview#183
I solved it by deleted packages which makes problem.

@AxanIqbal
Copy link

the flutter pub upgrade did fix my crash that prevent me from build. i guess some packages really needs to upgrade/check if its compatible with v3

@ahmeedev
Copy link

dependencies needs to be upgraded!!, wait for the authors to update the dependencies.

@maheshj01
Copy link
Member

Those warnings are coming from third-party plugins compiled against the older version of flutter, Updating the plugin code with dart fix --apply as mentioned in the release notes should help fix this issue. To reiterate this is just a warning this shouldn't break the build process.

originally filed here #101497 (closed)

@kaanaytemir
Copy link

kaanaytemir commented May 16, 2022

Upgrading my Kotlin version (manually), did the trick.

You can do that in your build.gradle.

buildscript {
    ext.kotlin_version = '1.6.21'
    repositories {
        google()
        jcenter()
    }

@ahmadrafidev
Copy link

Upgrading my Kotlin version (manually), did the trick.

You can do that in your build.gradle.

buildscript {
    ext.kotlin_version = '1.6.21'
    repositories {
        google()
        jcenter()
    }

doing the same thing, not work for me.

@cbalmeida

This comment was marked as abuse.

@pranavo72bex
Copy link

Any update ?

@BerndWessels
Copy link

Same here, upgraded to Flutter 3 and created a brand new app and getting:

Performing hot reload...
Syncing files to device Android SDK built for x86...
../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/flutter_web_auth-0.4.1/lib/flutter_web_auth.dart:33:20: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance?.removeObserver(_resumedObserver); // safety measure so we never add this observer twice
                   ^
../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/flutter_web_auth-0.4.1/lib/flutter_web_auth.dart:34:20: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance?.addObserver(_resumedObserver);
                   ^
../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/flutter_web_auth-0.4.1/lib/flutter_web_auth.dart:47:20: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance?.removeObserver(_resumedObserver);
                   ^
Reloaded 0 libraries in 193ms.

@hassanannajjar
Copy link

The same issue 💻
Any update?

@skuzakov-voc
Copy link

The same issue here. As far as I understand now, you can either ignore the warnings from third-party dependencies, or roll back to the previous version and wait until the dependency versions are updated to compatible with flutter 3.0.

@JacoFourie
Copy link

The app will not build. It is stated that they are only warnings but in my case the app will not build. So I can not ignore the warnings.

/E:/Flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_core-20.1.55/lib/src/legend/legend.dart:548:30: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.

  • 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/scheduler/binding.dart').
    SchedulerBinding.instance!.addPostFrameCallback(
    ^

FAILURE: Build failed with an exception.

  • Where:
    Script 'E:\Flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1156

  • What went wrong:
    Execution failed for task ':app:compileFlutterBuildDebug'.

Process 'command 'E:\Flutter\bin\flutter.bat'' finished with non-zero exit value 1

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 38s
Exception: Gradle task assembleDebug failed with exit code 1

@RudyLie1988
Copy link

Pre-Requisites

  • Flutter installed with the latest 3.0.0 stable, using FVM version manager.

Steps to Reproduce

  1. Execute flutter create test_app to create a new app
  2. Execute flutter run to build and run app

Expected results:

No warnings in debug console.

Actual results:

The following warnings are seen:

 Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
../…/src/framework.dart:275
- 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../../fvm/versions/stable/packages/flutter/lib/src/scheduler/binding.dart').
package:flutter/…/scheduler/binding.dart:1
    if (SchedulerBinding.instance!.schedulerPhase ==
                         ^
: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
../…/src/widgets_binding_observer.dart:42
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../fvm/versions/stable/packages/flutter/lib/src/widgets/binding.dart').
package:flutter/…/widgets/binding.dart:1
    _state = WidgetsBinding.instance!.lifecycleState;
                            ^

: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
../…/src/widgets_binding_observer.dart:43
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../fvm/versions/stable/packages/flutter/lib/src/widgets/binding.dart').
package:flutter/…/widgets/binding.dart:1
    WidgetsBinding.instance!.addObserver(this);
                   ^
: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
../…/src/widgets_binding_observer.dart:52

Code sample
Logs

I think i should share with you guys.
I update Flutter to latest version using Android Studio
image

When I run project, error shown below
image

Then I go to grouped_list.dart, and find function addPostFrameCallback.
I remove exclamation mark before function call.

If your editor prompt this, just proceed
image

Note:
I also change my build.gradle
from: ext.kotlin_version = '1.3.50'
to: ext.kotlin_version = '1.5.10'

Now my apps run without error.

@JacoFourie
Copy link

@RudyLie1988 the issue is not my own code but all the libraries and packages that I do not have control over also has them in. Yes I can remove it from my own code but your fix will not fix all the libs I am using. I did a Dart --fix and it removed all the ! from my own code but not the libs. And people say it should not stop the build. Yet it does break the build.

@Chaos-woo
Copy link

You can just ignore these warnings for now :)

i want to know how to ignore it? plz.

@jnthnklvn
Copy link

You can just ignore these warnings for now :)

i want to know how to ignore it? plz.

Just don't look at it

@JacoFourie
Copy link

@jnthnklvn are you trying to be funny? I can not ignore it as the build fails as I showed above. So not looking at it won't help.

@jnthnklvn
Copy link

@jnthnklvn are you trying to be funny? I can not ignore it as the build fails as I showed above. So not looking at it won't help.

No, I'm not. I was answering just about his mention. In your case could be this:

#103561 (comment)

@JacoFourie
Copy link

All works 100% and compiles using 2.10.5. After I upgrade to version 3 I get all these errors and the build will fail.
I updated the kotlin version to 1.6.21 also. Still no luck.
So how do I see what is causing the issue as this is the output.

Launching lib\main.dart on SM A013G in debug mode...
Running Gradle task 'assembleDebug'...
lib/screens/flow_screen.dart:176:20: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance?.addObserver(this);
                   ^
lib/screens/flow_screen.dart:342:20: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance?.removeObserver(this);
                   ^
lib/screens/flow_screen.dart:695:24: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/binding.dart').
        WidgetsBinding.instance?.addPostFrameCallback((_) {
                       ^
lib/screens/flow_screen.dart:735:22: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/binding.dart').
      WidgetsBinding.instance?.addPostFrameCallback((_) {
                     ^
lib/screens/flow_screen.dart:1877:20: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance?.addPostFrameCallback((_) {
                   ^
lib/screens/pv_screen.dart:85:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance!.addPostFrameCallback((_) {
                   ^
lib/screens/pv_history_chart_screen.dart:38:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance!.addObserver(this);
                   ^
lib/screens/pv_history_chart_screen.dart:50:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance!.addPostFrameCallback((_) {
                   ^
lib/screens/grid_screen.dart:61:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance!.addPostFrameCallback((_) {
                   ^
lib/screens/load_screen.dart:62:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance!.addPostFrameCallback((_) {
                   ^
lib/screens/load_history_chart_screen.dart:44:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance!.addObserver(this);
                   ^
lib/screens/load_history_chart_screen.dart:58:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance!.addPostFrameCallback((_) {
                   ^
lib/screens/battery_screen.dart:54:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance!.addPostFrameCallback((_) {
                   ^
lib/screens/systems_screen.dart:32:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance!.addPostFrameCallback((_) {
                   ^
lib/screens/profile_screen.dart:32:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance!.addPostFrameCallback((_) {
                   ^
lib/screens/battery_history_chart_screen.dart:44:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance!.addObserver(this);
                   ^
lib/screens/battery_history_chart_screen.dart:58:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance!.addPostFrameCallback((_) {
                   ^
lib/screens/overview_chart_screen.dart:45:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance!.addObserver(this);
                   ^
lib/screens/overview_chart_screen.dart:60:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance!.addPostFrameCallback((_) {
                   ^
lib/screens/overview_history_chart_screen.dart:48:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance!.addObserver(this);
                   ^
lib/screens/overview_history_chart_screen.dart:63:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance!.addPostFrameCallback((_) {
                   ^
lib/screens/grid_history_chart_screen.dart:44:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance!.addObserver(this);
                   ^
lib/screens/grid_history_chart_screen.dart:58:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance!.addPostFrameCallback((_) {
                   ^
lib/screens/log_screen.dart:33:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance!.addPostFrameCallback((_) {
                   ^
lib/screens/switch_screen.dart:28:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance!.addPostFrameCallback((_) {
                   ^
/E:/Flutter/.pub-cache/hosted/pub.dartlang.org/rive-0.8.4/lib/src/controllers/one_shot_controller.dart:40:26: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/binding.dart').
        : WidgetsBinding.instance?.addPostFrameCallback((_) => onStop?.call());
                         ^
/E:/Flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_charts-20.1.55/lib/src/chart/base/chart_base.dart:1820:26: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
 - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/scheduler/binding.dart').
        SchedulerBinding.instance!.addPostFrameCallback((_) {
                         ^
/E:/Flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_charts-20.1.55/lib/src/chart/base/chart_base.dart:1829:28: Warning: Operand of null-aware operation '?.' has type 'SchedulerBinding' which excludes null.
 - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/scheduler/binding.dart').
          SchedulerBinding.instance?.addPostFrameCallback((_) => _refresh());
                           ^
/E:/Flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_charts-20.1.55/lib/src/circular_chart/base/circular_base.dart:948:26: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
 - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/scheduler/binding.dart').
        SchedulerBinding.instance!.addPostFrameCallback((_) {
                         ^
/E:/Flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_charts-20.1.55/lib/src/circular_chart/base/circular_base.dart:962:28: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
 - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/scheduler/binding.dart').
          SchedulerBinding.instance!.addPostFrameCallback((_) => _refresh());
                           ^
/E:/Flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_charts-20.1.55/lib/src/funnel_chart/base/funnel_base.dart:720:26: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
 - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/scheduler/binding.dart').
        SchedulerBinding.instance!.addPostFrameCallback((_) {
                         ^
/E:/Flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_charts-20.1.55/lib/src/funnel_chart/base/funnel_base.dart:732:28: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
 - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/scheduler/binding.dart').
          SchedulerBinding.instance!.addPostFrameCallback((_) => _refresh());
                           ^
/E:/Flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_charts-20.1.55/lib/src/pyramid_chart/base/pyramid_base.dart:714:26: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
 - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/scheduler/binding.dart').
        SchedulerBinding.instance!.addPostFrameCallback((_) {
                         ^
/E:/Flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_charts-20.1.55/lib/src/pyramid_chart/base/pyramid_base.dart:725:28: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
 - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/scheduler/binding.dart').
          SchedulerBinding.instance!.addPostFrameCallback((_) => _refresh());
                           ^
/E:/Flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_datepicker-20.1.55/lib/src/date_picker/date_picker.dart:8063:22: Warning: Operand of null-aware operation '?.' has type 'SchedulerBinding' which excludes null.
 - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/scheduler/binding.dart').
    SchedulerBinding.instance?.addPostFrameCallback((_) {
                     ^
/E:/Flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_datepicker-20.1.55/lib/src/date_picker/date_picker.dart:9832:22: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
 - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/scheduler/binding.dart').
    SchedulerBinding.instance!.addPostFrameCallback((_) {
                     ^
/E:/Flutter/.pub-cache/hosted/pub.dartlang.org/rive-0.8.4/lib/src/rive_core/state_machine_controller.dart:220:24: Warning: Operand of null-aware operation '?.' has type 'SchedulerBinding' which excludes null.
 - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/scheduler/binding.dart').
      SchedulerBinding.instance?.addPostFrameCallback((_) {
                       ^
/E:/Flutter/.pub-cache/hosted/pub.dartlang.org/rive-0.8.4/lib/src/rive_render_box.dart:190:26: Warning: Operand of null-aware operation '?.' has type 'SchedulerBinding' which excludes null.
 - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/scheduler/binding.dart').
        SchedulerBinding.instance?.scheduleFrameCallback(_frameCallback) ?? -1;
                         ^
/E:/Flutter/.pub-cache/hosted/pub.dartlang.org/back_button_interceptor-5.0.2/lib/src/back_button_interceptor.dart:29:74: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/binding.dart').
  static Future<void> Function() handlePopRouteFunction = WidgetsBinding.instance!.handlePopRoute;
                                                                         ^
/E:/Flutter/.pub-cache/hosted/pub.dartlang.org/back_button_interceptor-5.0.2/lib/src/back_button_interceptor.dart:32:22: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/binding.dart').
      WidgetsBinding.instance!.handlePushRoute as Future<void> Function(String?);
                     ^
/E:/Flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_gauges-20.1.55/lib/src/linear_gauge/gauge/linear_gauge_scope.dart:40:10: Error: A value of type 'Widget' can't be assigned to a variable of type 'InheritedWidget'.
 - 'Widget' is from 'package:flutter/src/widgets/framework.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/framework.dart').
 - 'InheritedWidget' is from 'package:flutter/src/widgets/framework.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/framework.dart').
        .widget;
         ^
/E:/Flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_gauges-20.1.55/lib/src/radial_gauge/pointers/marker_pointer_renderer.dart:607:22: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/binding.dart').
      WidgetsBinding.instance!
                     ^
/E:/Flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_core-20.1.55/lib/src/legend/legend.dart:548:30: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
 - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('/E:/Flutter/packages/flutter/lib/src/scheduler/binding.dart').
            SchedulerBinding.instance!.addPostFrameCallback(
                             ^


FAILURE: Build failed with an exception.

* Where:
Script 'E:\Flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1156

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'E:\Flutter\bin\flutter.bat'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 9s
Exception: Gradle task assembleDebug failed with exit code 1

@jnthnklvn
Copy link

@JacoFourie, the error appears to have something about this:

/E:/Flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_gauges-20.1.55/lib/src/linear_gauge/gauge/linear_gauge_scope.dart:40:10: Error: A value of type 'Widget' can't be assigned to a variable of type 'InheritedWidget'.

  • 'Widget' is from 'package:flutter/src/widgets/framework.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/framework.dart').
  • 'InheritedWidget' is from 'package:flutter/src/widgets/framework.dart' ('/E:/Flutter/packages/flutter/lib/src/widgets/framework.dart').
    .widget;

May you can try to update that package and see if the build problem solves...

@Hixie
Copy link
Contributor

Hixie commented May 17, 2022

If you are getting an error please file a separate bug.

@Hixie
Copy link
Contributor

Hixie commented May 17, 2022

I'm going to close this issue since I think we understand it well now.

The underlying issue of showing warnings about dependencies is an issue we will resolve on the Dart side via dart-lang/sdk#46264.

If you are only getting warnings, meaning the app still runs, you may ignore them, they are harmless, and do not indicate a problem. As your dependencies update, the warnings will go away.

If you are getting errors, or if you appear to only be getting warnings but the app nonetheless does not build or execute, please file a new bug and we will try to determine the cause and resolve those issues. Make sure to include full logs from flutter run -v.

Thank you for your continued use of Flutter!

@Hixie Hixie closed this as completed May 17, 2022
@flutter flutter locked as resolved and limited conversation to collaborators May 17, 2022
@darshankawar darshankawar added the r: solved Issue is closed as solved label May 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: error message Error messages from the Flutter framework a: null-safety Support for the Dart's team new null safety feature customer: crowd Affects or could affect many people, though not necessarily a specific customer. framework flutter/packages/flutter repository. See also f: labels. P2 Important issues not at the top of the work list r: solved Issue is closed as solved
Projects
None yet
Development

No branches or pull requests