如何从github添加一个dart包到我的项目?

Phi*_*hil 6 dart

所以我有一个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'
Run Code Online (Sandbox Code Playgroud)

Gre*_*owe 8

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

例如,这个pubspec.yaml文件为kittens包添加了一个依赖项:

name: My Dart program
description: Blah
dependencies:
  kittens:
    git: git://github.com/munificent/kittens.git
Run Code Online (Sandbox Code Playgroud)

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