我正在学习 Dart,但是我发现了一个问题:
我想添加widget.dart包作为我项目的依赖项。但是在 pub.dartlang.org 中有非常旧的版本,它需要过时的 Web UI。有谁知道,如何从 GitHub 存储库获取 pub(并像从 pub.dartlang.org 一样安装它)?
我在 Windows 和 Dart 编辑器上使用 GitHub。
更新:我尝试将其添加到依赖项中并以经典方式运行“pub get”:
dependencies:
widget:
git: git@github.com:dart-lang/widget.dart.git
但它返回此错误:
--- 30.1.2014 15:35:27 Running pub get ... ---
Pub get failed, [1] Resolving dependencies...
Cannot get widget from Git (git@github.com:dart-lang/widget.dart.git).
Please ensure Git is correctly installed.
e:\b\build\slave\dart-editor-win-stable\build\dart\sdk\lib\_internal\pub\lib\src\source\git.dart 42 GitSource.downloadToSystemCache.<fn>
dart:isolate _RawReceivePortImpl._handleMessage
This is an unexpected error. Please run
pub --trace 'get'
and include the results in a bug report on http://dartbug.com/new.
** Warning: Application may fail to run since packages did not get installed.Try running pub get again. **