Flutter 3.0:在添加和使用弹奏插件之后获取错误

发布于 2025-01-31 20:46:13 字数 1019 浏览 4 评论 0原文

添加了字幕插件并使用它后,我总是会遇到此错误,

../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/fading_edge_scrollview-2.0.1/lib/src/fading_edge_scrollview.dart:195:20: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../development/flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance?.let((it) {
                   ^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/fading_edge_scrollview-2.0.1/lib/src/fading_edge_scrollview.dart:220:20: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../development/flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance?.removeObserver(this);

我删除了插件并删除了字幕,并且该应用程序正在运行而没有错误。 字幕插件有问题吗?

               ^

After i added the marquee plugin and used it, I always get this error

../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/fading_edge_scrollview-2.0.1/lib/src/fading_edge_scrollview.dart:195:20: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../development/flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance?.let((it) {
                   ^
../../../development/flutter/.pub-cache/hosted/pub.dartlang.org/fading_edge_scrollview-2.0.1/lib/src/fading_edge_scrollview.dart:220:20: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
 - 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../development/flutter/packages/flutter/lib/src/widgets/binding.dart').
    WidgetsBinding.instance?.removeObserver(this);

I removed the plugin and deleted the marquee and the application is running without an error.
Is there something wrong with the marquee plugin ?

               ^

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

百合的盛世恋 2025-02-07 20:46:13

不幸的是,Flutter 3.0.0引入了某些属性的无效性变化。

仍在积极开发的最常见的软件包发布了更新版本以支持它。

fading_edge_scrollview似乎是这里没有更新版本的版本(尚未)。我不知道它是否正在积极发展。

您可以尝试分叉并自己修复它,也可以忽略警告。
因为这实际上只是警告。即使在这些警告下,您的应用程序仍应正常工作。

Unfortunately Flutter 3.0.0 introduced some changes in the nullability of some properties.

The most common packages that are still actively being developed released updated versions to support it.

fading_edge_scrollview seems the be the one here that doesn't have an updated version (yet). I have no idea if it's being actively developed.

You could try to fork it and fix it yourself, or you could just ignore the warning.
Because it is in fact only a warning. Your app should still work properly even with those warnings.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文