如何为Dart创建库? [英] How to create libraries for Dart?
本文介绍了如何为Dart创建库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用Dart创建库?
How can I create libraries using Dart?
我想开始将我创建的一些JavaScript(和其他语言)库移植到Dart.
I want to start porting some JavaScript (and other languages) libraries I've created to Dart.
推荐答案
只需将其放在您的库文件中(第一名):
Just put this in your library file (first place):
library mylibraryname;
然后可以使用以下命令导入该库:
You can then import this lib with:
import "path/to/mylibraryname.dart";
其他选项可用,例如 part
.
有关更深入的教程,我建议您博客来自Dartwatch的帖子.
For a more in-depth tutorial I recommend you this blog post from Dartwatch.
这篇关于如何为Dart创建库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文