I am trying to run dartdoc for my flutter package but I am getting this,
dartdoc failed: Top level package requires Flutter but FLUTTER_ROOT environment variable not set.
How to add FLUTTER_ROOT environment variable as I have already added environment variable for Flutter SDK and that's working fine, I am just getting issue while running dartdoc
. I am a Linux user.
try running flutter pub global run dartdoc:dartdoc
instead
If you wish to generate API documentation locally on your development machine, use the following commands:
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
link https://flutter.dev/docs/development/packages-and-plugins/developing-packages
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With