当前位置:网站首页>Operand of null-aware operation ‘!‘ has type ‘SchedulerBinding‘ which excludes null.

Operand of null-aware operation ‘!‘ has type ‘SchedulerBinding‘ which excludes null.

2022-07-06 22:36:00 刘刘小博

报错如图

…/…/Documents/flutter/.pub-cache/hosted/pub.flutter-io.cn/animations-2.0.2/lib/src/open_container.dart:631:24: Warning: Operand of null-aware operation ‘!’ has type ‘SchedulerBinding’ which excludes null.

  • ‘SchedulerBinding’ is from ‘package:flutter/src/scheduler/binding.dart’ (‘…/…/Documents/flutter/packages/flutter/lib/src/scheduler/binding.dart’).
    SchedulerBinding.instance!请添加图片描述

原因

是 animations 库的版本低了,需要更新
请添加图片描述

修复

将版本号增加到足够大即可,我这里增加到2.0.3就可以了请添加图片描述

原网站

版权声明
本文为[刘刘小博]所创,转载请带上原文链接,感谢
https://blog.csdn.net/LIUXIAOXIAOBO/article/details/125630321