VelocityX
VelocityX copied to clipboard
Method 'addObserver' cannot be called on 'WidgetsBinding?' because it is potentially null.
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/velocity_x-3.5.1/lib/src/flutter/common/velocity_ensure_visible.dart:67:29: Error: Method 'addObserver' cannot be called on 'WidgetsBinding?' because it is potentially null.
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/C:/flutter/packages/flutter/lib/src/widgets/binding.dart'). Try calling using ?. instead. WidgetsBinding.instance.addObserver(this); ^^^^^^^^^^^ /C:/flutter/.pub-cache/hosted/pub.dartlang.org/velocity_x-3.5.1/lib/src/flutter/common/velocity_ensure_visible.dart:72:29: Error: Method 'removeObserver' cannot be called on 'WidgetsBinding?' because it is potentially null.
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/C:/flutter/packages/flutter/lib/src/widgets/binding.dart'). Try calling using ?. instead. WidgetsBinding.instance.removeObserver(this); ^^^^^^^^^^^^^^ /C:/flutter/.pub-cache/hosted/pub.dartlang.org/velocity_x-3.5.1/lib/src/flutter/drawer.dart:150:29: Error: Method 'addPostFrameCallback' cannot be called on 'WidgetsBinding?' because it is potentially null.
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/C:/flutter/packages/flutter/lib/src/widgets/binding.dart'). Try calling using ?. instead. WidgetsBinding.instance.addPostFrameCallback(getBoxHeight); ^^^^^^^^^^^^^^^^^^^^ /C:/flutter/.pub-cache/hosted/pub.dartlang.org/velocity_x-3.5.1/lib/src/flutter/marquee.dart:51:29: Error: Method 'addPostFrameCallback' cannot be called on 'WidgetsBinding?' because it is potentially null.
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/C:/flutter/packages/flutter/lib/src/widgets/binding.dart'). Try calling using ?. instead. WidgetsBinding.instance.addPostFrameCallback((callback) { ^^^^^^^^^^^^^^^^^^^^ /C:/flutter/.pub-cache/hosted/pub.dartlang.org/velocity_x-3.5.1/lib/src/flutter/popup_menu.dart:186:29: Error: Method 'addPostFrameCallback' cannot be called on 'WidgetsBinding?' because it is potentially null.
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/C:/flutter/packages/flutter/lib/src/widgets/binding.dart'). Try calling using ?. instead. WidgetsBinding.instance.addPostFrameCallback((call) { ^^^^^^^^^^^^^^^^^^^^
FAILURE: Build failed with an exception.
-
Where: Script 'C:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1102
-
What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command 'C:\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 30s Exception: Gradle task assembleDebug failed with exit code 1
Hi, I have the same bug, any news?
Which flutter version you are using @adomiciliooapp, @abhihasabe ?
this is known issue when using flutter before 3. downgrade to version 3.4.0 for temporary solution
Fixed in 3.6.0