首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >在dart中创建包

在dart中创建包
EN

Stack Overflow用户
提问于 2013-09-02 16:12:57
回答 7查看 5.7K关注 0票数 4

如何在新的Dart编辑器中创建包?

没有"Add Pub support“复选框?

另外,如何使用新的编辑器创建“包”?

有没有一个教程描述了使用新编辑器的过程?

EN

回答 7

Stack Overflow用户

发布于 2020-07-16 03:46:06

从Dart/Flutter文档中:

步骤1:创建包要创建Flutter包,请使用带有flutter Create的--template=package标志:

flutter create --template=package hello

这将在hello文件夹中创建一个包含以下内容的包项目:

代码语言:javascript
代码运行次数:0
运行
复制
LICENSE
A (mostly) empty license text file.

test/hello_test.dart
The unit tests for the package.

hello.iml
A configuration file used by the IntelliJ IDEs.

.gitignore
A hidden file that tells Git which files or folders to ignore in a project.

.metadata
A hidden file used by IDEs to track the properties of the Flutter project.

pubspec.yaml
A yaml file containing metadata that specifies the package’s dependencies. Used by the pub tool.

README.md
A starter markdown file that briefly describes the package’s purpose.

lib/hello.dart
A starter app containing Dart code for the package.

.idea/modules.xml, .idea/modules.xml, .idea/workspace.xml**
A hidden folder containing configuration files for the IntelliJ IDEs.

CHANGELOG.md
A (mostly) empty markdown file for tracking version changes to the package.
票数 5
EN

Stack Overflow用户

发布于 2021-02-04 03:27:52

创建一个名为mypackage的包。

对于Dart包:

代码语言:javascript
代码运行次数:0
运行
复制
dart  create --template=package-simple  mypackage

对于Flutter包:

代码语言:javascript
代码运行次数:0
运行
复制
flutter create --template=package mypackage
票数 5
EN

Stack Overflow用户

发布于 2013-09-02 16:28:41

目前在Dart编辑器中没有这样的可能性。要创建包,请执行以下步骤:

  • 创建不带示例内容的新应用程序mylib
  • 添加pubspec.yaml文件
  • 添加lib文件夹<代码>H29<代码>H110创建包含要打包的代码的<代码>D11<代码>H212<代码>F213

有关更多信息,请参阅Package layout conventions

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18568459

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档