Flutter cannot generate docs with dartdoc

1.6k Views Asked by At

I am not able to generate the documentation of the code by using the dartdoc tool located at C:\flutter\bin\cache\dart-sdk\bin. This is what I do:

  1. Go to the project dir dir C:\Users\alber\Documents\progetto_fomet\fomet_app\lib

  2. Call the command dartdoc

It works because in C:\Users\alber\Documents\progetto_fomet\fomet_app\lib\doc\api I see the documentation but it doe NOT include the documentation of my code!

The tool generates the doc of dart like here

enter image description here

but it does NOT generate the doc of my app in flutter

enter image description here

In red you see the source of my app that is not being doc-generated in doc\api. What to do?

I am on Windows 10

1

There are 1 best solutions below

0
Imran Sefat On

I was struggling with this a lot. Solved by the following steps using the PowerShell:

  1. Installing CHOCOLATEY from https://chocolatey.org/install#individual
  2. Activating dartdoc using flutter pub global activate dartdoc
  3. Activating dhttpd using flutter pub global activate dhttpd
  4. Generating the documentation dartdoc on the project folder
  5. Viewing the generated files using dhttpd --path doc/api

Alternatively on macOS you can use Homebrew to install the dartdoc and dhttpd