我正在尝试为我的颤振包运行 dartdoc,但我得到了这个,
dartdoc failed: Top level package requires Flutter but FLUTTER_ROOT environment variable not set.
如何添加 FLUTTER_ROOT 环境变量,因为我已经为 Flutter SDK 添加了环境变量并且工作正常,我只是在运行时遇到问题dartdoc
。我是 Linux 用户。
尝试flutter pub global run dartdoc:dartdoc
运行
如果您希望在开发机器上本地生成 API 文档,请使用以下命令:
cd ~/dev/mypackage
export FLUTTER_ROOT=~/dev/flutter # on macOS or Linux
set FLUTTER_ROOT=~/dev/flutter # on Windows
$FLUTTER_ROOT/bin/cache/dart-sdk/bin/dartdoc # on macOS or Linux
%FLUTTER_ROOT%\bin\cache\dart-sdk\bin\dartdoc # on Windows
链接https://flutter.dev/docs/development/packages-and-plugins/developing-packages