android - Flutter 依赖错误 (flutter_svg: ^0.19.2+1)
问题描述
当我尝试添加 flutter_svg 依赖项以在我的项目中添加 SVG 格式图片时,它会抛出这样的错误:
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.19.2+1/lib/src/picture_provider.dart:57:59: Error: No named parameter with the name 'nullOk'.
context != null ? Localizations.localeOf(context, nullOk: true) : null,
^^^^^^
/C:/src/flutter/packages/flutter/lib/src/widgets/localizations.dart:413:17: Context: Found this candidate, but the arguments don't match.
static Locale localeOf(BuildContext context) {
我正在使用颤振(频道主,1.26.0-18.0.pre.193)。和flutter_svg:^0.19.2+1
我也使用了此依赖项的较低版本,但仍然出现相同的错误。
解决方案
添加以下依赖项
flutter_svg:^0.20.0-nullsafety.3
代替
颤振_svg:^0.19.2+1
然后按照这些步骤
- 扑干净
- 扑吧酒吧
- 扑跑
推荐阅读
- java - 'enableDefaultTyping(com.fasterxml.jackson.databind.ObjectMapper.DefaultTyping)' 在 RedisConfig 中已弃用
- c - 从函数返回结构后,文件删除和重命名不起作用
- android - Android平台makefile(Android.bp),如何使用kotlin @Parcelize注解创建aidl文件?
- mysql - 从 Drupal 7 迁移博客数据,结合两个 select 语句并创建输出表
- r - 如何从先验规则中子集项目列表?
- typescript - Typescript 属性类型保护未知
- c++ - 将 TopoDS_Shape 的中心平移(移动)到原点
- javascript - 你能把 null 的本地 dexie DB 值更改为没有值的字符串吗
- javascript - (未应用moduleNameMapper)Vue jest 配置错误:“找不到模块@/javascript/app.vue 映射为:”
- javascript - For 循环表内容中的删除按钮