【问题标题】:How to add a dart package from github to my project?如何将来自 github 的 dart 包添加到我的项目中?
【发布时间】:2013-11-30 18:03:10
【问题描述】:

所以我有一个 dart 程序,我想从 github 添加一个 dart 包,而不是使用 IDE 包管理器添加包的正常方式,因为 github 版本具有最新代码。

执行此操作的过程是什么?


这在现实世界中对我有用。

name: game
description: A sample web application
dependencies:
  browser: any
  three:
    git:
      ref: master
      url: 'git://github.com/threeDart/three.dart.git'

【问题讨论】:

    标签: dart


    【解决方案1】:

    您可以在 pubspec.yaml 文件中添加一个依赖项,该文件直接指向一个 git url。

    例如,这个 pubspec.yaml 文件添加了对 kittens 包的依赖:

    name: My Dart program
    description: Blah
    dependencies:
      kittens:
        git: git://github.com/munificent/kittens.git
    

    有关更多信息,请参阅pubspec.yaml docs

    【讨论】:

      猜你喜欢
      • 2019-05-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-08-18
      • 2019-05-30
      • 2019-01-24
      • 2023-04-08
      • 2014-06-13
      相关资源
      最近更新 更多