getx icon indicating copy to clipboard operation
getx copied to clipboard

Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.

Open nEdAy opened this issue 2 years ago • 15 comments

Describe the bug

Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.

Version (please complete the following information):

Flutter Version: Flutter 3.0.0 • channel stable OS: Android Getx Version : 4.6.1 Additional context Add any other context about the problem here.

nEdAy avatar May 12 '22 03:05 nEdAy

Same Issue.

Flutter Version: Flutter 3.0.0 OS: IOS Getx Version : 4.6.1

necessarylion avatar May 12 '22 04:05 necessarylion

same issue Flutter Version: Flutter 3.0.0 OS: IOS Getx Version : 4.6.1

alihassan143 avatar May 12 '22 04:05 alihassan143

same issue Flutter Version: Flutter 3.0.0 OS: Android Getx Version : 4.6.1

zhao004 avatar May 12 '22 05:05 zhao004

It needs a very small update to remove the warning. I hope they do it soon.

holy-dev avatar May 12 '22 05:05 holy-dev

New version released 4.62

Shreemanarjun avatar May 12 '22 17:05 Shreemanarjun

#2351

Flutter Version: Flutter 2.10.5 OS: Android Getx Version : 4.6.3

Syncing files to device iPhone 13... ../../../../.pub-cache/hosted/pub.flutter-io.cn/get-4.6.3/lib/get_navigation/src/snackbar/snackbar.dart:452:31: Error: Method 'addPostFrameCallback' cannot be called on 'SchedulerBinding?' because it is potentially null.

  • 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../../../fvm/versions/2.10.5/packages/flutter/lib/src/scheduler/binding.dart'). Try calling using ?. instead. SchedulerBinding.instance.addPostFrameCallback( ^^^^^^^^^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.flutter-io.cn/get-4.6.3/lib/get_navigation/src/router_report.dart:53:31: Error: Method 'addPostFrameCallback' cannot be called on 'WidgetsBinding?' because it is potentially null.
  • 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../../fvm/versions/2.10.5/packages/flutter/lib/src/widgets/binding.dart'). Try calling using ?. instead. WidgetsBinding.instance.addPostFrameCallback((_) { ^^^^^^^^^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.flutter-io.cn/get-4.6.3/lib/get_state_manager/src/simple/get_controllers.dart:90:29: Error: Method 'addObserver' cannot be called on 'WidgetsBinding?' because it is potentially null.
  • 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../../fvm/versions/2.10.5/packages/flutter/lib/src/widgets/binding.dart'). Try calling using ?. instead. WidgetsBinding.instance.addObserver(this); ^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.flutter-io.cn/get-4.6.3/lib/get_state_manager/src/simple/get_controllers.dart:96:29: Error: Method 'removeObserver' cannot be called on 'WidgetsBinding?' because it is potentially null.
  • 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../../fvm/versions/2.10.5/packages/flutter/lib/src/widgets/binding.dart'). Try calling using ?. instead. WidgetsBinding.instance.removeObserver(this); ^^^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.flutter-io.cn/get-4.6.3/lib/get_state_manager/src/rx_flutter/rx_notifier.dart:130:31: Error: Method 'addPostFrameCallback' cannot be called on 'SchedulerBinding?' because it is potentially null.
  • 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../../../fvm/versions/2.10.5/packages/flutter/lib/src/scheduler/binding.dart'). Try calling using ?. instead. SchedulerBinding.instance.addPostFrameCallback((_) => onReady()); ^^^^^^^^^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.flutter-io.cn/get-4.6.3/lib/get_navigation/src/extension_navigation.dart:357:33: Error: Method 'addPostFrameCallback' cannot be called on 'SchedulerBinding?' because it is potentially null.
  • 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../../../fvm/versions/2.10.5/packages/flutter/lib/src/scheduler/binding.dart'). Try calling using ?. instead. SchedulerBinding.instance.addPostFrameCallback((_) { ^^^^^^^^^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.flutter-io.cn/get-4.6.3/lib/get_navigation/src/extension_navigation.dart:468:33: Error: Method 'addPostFrameCallback' cannot be called on 'SchedulerBinding?' because it is potentially null.
  • 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../../../fvm/versions/2.10.5/packages/flutter/lib/src/scheduler/binding.dart'). Try calling using ?. instead. SchedulerBinding.instance.addPostFrameCallback((_) { ^^^^^^^^^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.flutter-io.cn/get-4.6.3/lib/get_navigation/src/extension_navigation.dart:357:33: Error: Method 'addPostFrameCallback' cannot be called on 'SchedulerBinding?' because it is potentially null.
  • 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../../../fvm/versions/2.10.5/packages/flutter/lib/src/scheduler/binding.dart'). Try calling using ?. instead. SchedulerBinding.instance.addPostFrameCallback((_) { ^^^^^^^^^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.flutter-io.cn/get-4.6.3/lib/get_navigation/src/extension_navigation.dart:468:33: Error: Method 'addPostFrameCallback' cannot be called on 'SchedulerBinding?' because it is potentially null.
  • 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../../../fvm/versions/2.10.5/packages/flutter/lib/src/scheduler/binding.dart'). Try calling using ?. instead. SchedulerBinding.instance.addPostFrameCallback((_) { ^^^^^^^^^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.flutter-io.cn/get-4.6.3/lib/get_navigation/src/snackbar/snackbar.dart:452:31: Error: Method 'addPostFrameCallback' cannot be called on 'SchedulerBinding?' because it is potentially null.
  • 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../../../fvm/versions/2.10.5/packages/flutter/lib/src/scheduler/binding.dart'). Try calling using ?. instead. SchedulerBinding.instance.addPostFrameCallback( ^^^^^^^^^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.flutter-io.cn/get-4.6.3/lib/get_state_manager/src/rx_flutter/rx_notifier.dart:130:31: Error: Method 'addPostFrameCallback' cannot be called on 'SchedulerBinding?' because it is potentially null.
  • 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../../../fvm/versions/2.10.5/packages/flutter/lib/src/scheduler/binding.dart'). Try calling using ?. instead. SchedulerBinding.instance.addPostFrameCallback((_) => onReady()); ^^^^^^^^^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.flutter-io.cn/get-4.6.3/lib/get_state_manager/src/simple/get_controllers.dart:90:29: Error: Method 'addObserver' cannot be called on 'WidgetsBinding?' because it is potentially null.
  • 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../../fvm/versions/2.10.5/packages/flutter/lib/src/widgets/binding.dart'). Try calling using ?. instead. WidgetsBinding.instance.addObserver(this); ^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.flutter-io.cn/get-4.6.3/lib/get_state_manager/src/simple/get_controllers.dart:96:29: Error: Method 'removeObserver' cannot be called on 'WidgetsBinding?' because it is potentially null.
  • 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../../fvm/versions/2.10.5/packages/flutter/lib/src/widgets/binding.dart'). Try calling using ?. instead. WidgetsBinding.instance.removeObserver(this); ^^^^^^^^^^^^^^ ../../../../.pub-cache/hosted/pub.flutter-io.cn/get-4.6.3/lib/get_navigation/src/router_report.dart:53:31: Error: Method 'addPostFrameCallback' cannot be called on 'WidgetsBinding?' because it is potentially null.
  • 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../../fvm/versions/2.10.5/packages/flutter/lib/src/widgets/binding.dart'). Try calling using ?. instead. WidgetsBinding.instance.addPostFrameCallback((_) { ^^^^^^^^^^^^^^^^^^^^ Restarted application in 1,460ms.

nEdAy avatar May 13 '22 01:05 nEdAy

same issue Flutter Version: Flutter 2.10.5 OS: Android Getx Version : 4.6.3

zanpen2000 avatar May 13 '22 08:05 zanpen2000

In my case I solve this issue temporary, i did this steps:

  • i downgrade the flutter version to 1.10.5 with flutter downgrade v2.10.5.
  • i remove all the get package version in /snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org, rm -rf "get-4.6.*".
  • i change the version in my pubspec.lock
  get:
    dependency: "direct main"
    description:
      name: get
      url: "https://pub.dartlang.org"
    source: hosted
    version: "4.6.3" -> Change 4.6.3 to 4.6.1
  • flutter clean and flutter pub get.

I hope this work for you guys!

flaviopopoff avatar May 13 '22 09:05 flaviopopoff

I solve this issue, i did this steps:

  • i downgrade the flutter version to 1.10.5 with flutter downgrade v2.10.5.
  • i remove all the get package version in /snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org, rm -rf "get-4.6.*".
  • i change the version in my pubspec.lock
  get:
    dependency: "direct main"
    description:
      name: get
      url: "https://pub.dartlang.org"
    source: hosted
    version: "4.6.3" -> Change 4.6.3 to 4.6.1
  • flutter clean and flutter pub get.

I hope this work for you guys!

This is a temporary solution. get: ^4.6.1 -> get: 4.6.1 flutter pub get

nEdAy avatar May 13 '22 10:05 nEdAy

You can use it for a temporary fix before PR https://github.com/jonataslaw/getx/pull/2360 https://github.com/arjundevlucid/getx

arjundevlucid avatar May 14 '22 13:05 arjundevlucid

I solve this issue, i did this steps:

  • i downgrade the flutter version to 1.10.5 with flutter downgrade v2.10.5.
  • i remove all the get package version in /snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org, rm -rf "get-4.6.*".
  • i change the version in my pubspec.lock
  get:
    dependency: "direct main"
    description:
      name: get
      url: "https://pub.dartlang.org"
    source: hosted
    version: "4.6.3" -> Change 4.6.3 to 4.6.1
  • flutter clean and flutter pub get.

I hope this work for you guys!

This is a temporary solution. get: ^4.6.1 -> get: 4.6.1 flutter pub get

This worked for me

isiyemijoe avatar May 15 '22 08:05 isiyemijoe

In my case I solve this issue temporary, i did this steps:

  • i downgrade the flutter version to 1.10.5 with flutter downgrade v2.10.5.
  • i remove all the get package version in /snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org, rm -rf "get-4.6.*".
  • i change the version in my pubspec.lock
  get:
    dependency: "direct main"
    description:
      name: get
      url: "https://pub.dartlang.org"
    source: hosted
    version: "4.6.3" -> Change 4.6.3 to 4.6.1
  • flutter clean and flutter pub get.

I hope this work for you guys!

worked for me, big thanks

noveindrasalim avatar May 15 '22 14:05 noveindrasalim

seems this issue is now fixed in 3.0.1,

yaantow avatar May 23 '22 17:05 yaantow

Try this version of percent indicator with double quotes. percent_indicator: "^2.1.9+1" Worked for me

smi021 avatar Aug 30 '22 09:08 smi021

This issue should be closed now as it is fixed a long ago

holy-dev avatar Sep 05 '22 10:09 holy-dev