每当我try 运行我的Flutter 应用程序时,我都会遇到这个错误,
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/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' ('../../../development/flutter/packages/flutter/lib/src/scheduler/binding.dart').
Try calling using ?. instead.
SchedulerBinding.instance.addPostFrameCallback((_) {
^^^^^^^^^^^^^^^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/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' ('../../../development/flutter/packages/flutter/lib/src/scheduler/binding.dart').
Try calling using ?. instead.
SchedulerBinding.instance.addPostFrameCallback((_) {
^^^^^^^^^^^^^^^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/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' ('../../../development/flutter/packages/flutter/lib/src/scheduler/binding.dart').
Try calling using ?. instead.
SchedulerBinding.instance.addPostFrameCallback(
^^^^^^^^^^^^^^^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/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' ('../../../development/flutter/packages/flutter/lib/src/scheduler/binding.dart').
Try calling using ?. instead.
SchedulerBinding.instance.addPostFrameCallback((_) => onReady());
^^^^^^^^^^^^^^^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/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' ('../../../development/flutter/packages/flutter/lib/src/widgets/binding.dart').
Try calling using ?. instead.
WidgetsBinding.instance.addObserver(this);
^^^^^^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/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' ('../../../development/flutter/packages/flutter/lib/src/widgets/binding.dart').
Try calling using ?. instead.
WidgetsBinding.instance.removeObserver(this);
^^^^^^^^^^^^^^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/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' ('../../../development/flutter/packages/flutter/lib/src/widgets/binding.dart').
Try calling using ?. instead.
WidgetsBinding.instance.addPostFrameCallback((_) {
^^^^^^^^^^^^^^^^^^^^
失败:生成失败,出现异常.
* Where:
Script '/home/ibrahimdev/development/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1102
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/home/ibrahimdev/development/flutter/bin/flutter'' 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
构建在18秒内失败