flutter - 为什么依赖项覆盖在颤振中不能按预期工作?
问题描述
我想强制我的项目使用hooks_riverpod
version 1.0.0-dev.6
,所以我在 pubspect.yaml 中指定依赖项,如下所示:
dependencies:
hooks_riverpod: 1.0.0-dev.6
dependency_overrides:
hooks_riverpod: 1.0.0-dev.6
但是当我编译项目时,依赖项仍然使用另一个版本1.0.0-dev.10
:
../../../.pub-cache/hosted/pub.dartlang.org/riverpod-1.0.0-dev.10/lib/src/async_value_converters.dart:223:39: Error: The method 'ignore' isn't defined for the class 'Future<State>'.
- 'Future' is from 'dart:async'.
Try correcting the name to the name of an existing method, or defining a method named 'ignore'.
loadingCompleter!.future..ignore(),
我错过了什么吗?我应该怎么做才能使用版本强制颤振依赖1.0.0-dev.6
?顺便说一句,我已经跑flutter update/upgrade/outdate
了很多次了。我还尝试删除 pub-cache 文件夹并重新下载依赖包。我发现 .packages 文件总是自动生成这一行:
riverpod:file:///Users/dolphin/.pub-cache/hosted/pub.dartlang.org/riverpod-1.0.0-dev.10/lib/
这是我的颤振版本信息:
$ ~/apps/flutter/bin/flutter doctor ‹ruby-2.7.2›
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.2.3, on macOS 11.2.3 20D91 darwin-x64, locale en-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[!] Android Studio (version 2020.3)
✗ Unable to find bundled Java version.
[✓] IntelliJ IDEA Ultimate Edition (version 2021.2.2)
[✓] VS Code (version 1.60.2)
[✓] Connected device (3 available)
! Error: xiaoqiang 的 iPhone is not connected. Xcode will continue when xiaoqiang 的 iPhone is connected. (code -13)
! Doctor found issues in 1 category.
(base)
解决方案
推荐阅读
- javascript - 如何持续关注 MongoDB 并更新我的 UI?
- python - Python在引发异常后添加重试
- c# - Selenium c# IWebElement 列表旧参考
- amazon-web-services - 我的 Kubernetes 集群上的 AWS redis 连接错误
- python - AMD Ryzen 5950X 在 MKL 2020.0 和 MKL_DEBUG_CPU_TYPE=5 下运行缓慢
- pine-script - 参考 MA 交叉前的柱线,在交叉前绘制三角形 50 根柱线
- html - 重新定位行移动
- arrays - 将“void *(struct thread_args *)”传递给“void * _Nullable (* _Nonnull)(void * _Nullable)”类型参数的不兼容指针类型
- spring - 在 SCG 中将 SCLB 与多个服务器列表一起使用
- mysql - 使用python使用mysql.connector传输数据时出现MySQL连接错误