gpt4 book ai didi

flutter - 警告 : Operand of null-aware operation '!' has type 'PaintingBinding' which excludes null

转载 作者:行者123 更新时间:2023-12-05 05:46:37 27 4
gpt4 key购买 nike

我正在尝试在 android studio 中构建我的 flutter 项目,注意我在这个项目中没有使用fade Duration

我在升级flutter和android studio的时候遇到了这个问题

问题:


/C:/Users/USER/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/flutter_math_fork-0.5.0/lib/src/widgets/selection/overlay.dart:195:24: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
- 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('/D:/src1/flutter/packages/flutter/lib/src/scheduler/binding.dart').
SchedulerBinding.instance!.addPostFrameCallback(_markNeedsBuild);
^
/C:/Users/USER/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/flutter_math_fork-0.5.0/lib/src/widgets/selection/handle_overlay.dart:60:40: Error: Member not found: 'fadeDuration'.
duration: TextSelectionOverlay.fadeDuration, vsync: this);
^^^^^^^^^^^^


FAILURE: Build failed with an exception.

* Where:
Script 'D:\src1\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1148

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'D:\src1\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 51s
Exception: Gradle task assembleDebug failed with exit code 1

最佳答案

lib flutter_math_fork-0.5.0 可以在另一个库上使用,但是最新的 flutter 不支持方法 TextSelectionOverlay.fadeDuration您只需在 pubspec.yaml

上覆盖较新版本的 flutter_math_fork

例子:

dependency_overrides:
flutter_math_fork: ^0.6.1

关于flutter - 警告 : Operand of null-aware operation '!' has type 'PaintingBinding' which excludes null,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71140668/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com