在Flutter中,依赖项必须指定版本号吗? [英] In Flutter, Dependencies must specify version number?
问题描述
通常,您必须添加以下内容
Typically, you have to add something like
dependencies:
camera: "^0.2.0"
到pubspec.yaml文件。如果我不包含版本号怎么办?这是一件小事,但通常,我会找到一段代码并想要对其进行测试。在顶部,我看到类似>>
to the pubspec.yaml file. What happens if I don't include the version number? It's a small thing, but usually, I find a piece of code and want to test it. At the top, I see something like >>
import 'package:camera/camera.dart';
我是否必须进入软件包的主页以找到版本号?
Do I have to go to the package's homepage to find the version number?
推荐答案
您可以使用任何
dependencies:
camera: any
约束使包获取
/ 包升级
更容易搜索匹配版本,因为它减少了解决方案空间,但是对于简单
Having tighter constraints makes it easier for packages get
/packages upgrade
to search matching versions because it reduces the solution space, but for simple examples it usually doesn't matter.
pub
最近得到了改进的求解器,使得任何
问题都比过去 pub
经常在任何$ c $时超时的问题少得多c>被使用。
pub
got an improved solver recently that makes any
much less of a problem than it used to be where pub
often just timed out when any
was used.
这篇关于在Flutter中,依赖项必须指定版本号吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!