gpt4 book ai didi

dart - Path Package 应该在工程内容之内?

转载 作者:IT王子 更新时间:2023-10-29 07:14:12 24 4
gpt4 key购买 nike

有人知道如何使用“路径包”吗?引用:https://www.dartlang.org/tools/pub/dependencies#path-packages

我尝试引入另一个名为“mvc”的应用程序,但它不喜欢路径:../mvc/

name: startup_namerdescription: A new Flutter application.dependencies:  flutter:    sdk: flutter  mvc:    path: ../mvc/

它找到了 mvc 的包文件 pubspec.yaml,但我认为它在提示该文件夹不在该项目的内容中(不管那是什么意思?!)

这是错误信息:

Folder C:\Programs\Tools\Projects\Flutter\mvc is not in project content less... (Ctrl+F1) This inspection works in pubspec.yaml file and checks path references for dependencies configured as Path Packages:Path must be valid and target folder must contain pubspec.yaml file.Path Package should be within the project content, otherwise files from such packages are not editable.Example of pubspec.yaml file: name: my_dart_projectversion: 0.0.1dependencies:  my_another_dart_project:    path: ../my_another_dart_project

它是否需要文件夹 mvc/,“在”其他项目的目录中??

最佳答案

尽管它继续“提示”它不在项目内容中,但它确实有效。您只是无法编辑文件(当然您可以——只能在他们自己的项目中。)

现在成功导入 dart 文件的技巧是,在查看文件 pubspec.yaml 时,现在执行 pub 操作(例如“获取依赖项”或“升级依赖项”)。

它们链接在窗口的右上角。命令本身甚至可能会以错误代码执行,但您会发现您的外部系统文件包现在在“项目 View ”中列在 Dart 包下。

Package comes in after performing an unsuccessful Pub action.

关于dart - Path Package 应该在工程内容之内?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49470439/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com