Flutter 3.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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,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.