getx
getx copied to clipboard
Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
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.
Same Issue.
Flutter Version: Flutter 3.0.0 OS: IOS Getx Version : 4.6.1
same issue Flutter Version: Flutter 3.0.0 OS: IOS Getx Version : 4.6.1
same issue Flutter Version: Flutter 3.0.0 OS: Android Getx Version : 4.6.1
It needs a very small update to remove the warning. I hope they do it soon.
New version released 4.62
#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.
same issue Flutter Version: Flutter 2.10.5 OS: Android Getx Version : 4.6.3
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
andflutter pub get
.
I hope this work for you guys!
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
andflutter 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
You can use it for a temporary fix before PR https://github.com/jonataslaw/getx/pull/2360 https://github.com/arjundevlucid/getx
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
andflutter 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
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
andflutter pub get
.I hope this work for you guys!
worked for me, big thanks
seems this issue is now fixed in 3.0.1,
Try this version of percent indicator with double quotes. percent_indicator: "^2.1.9+1" Worked for me
This issue should be closed now as it is fixed a long ago