2

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

Paul L
  • 73
  • 7
  • Did you run just `dartdoc` or did you give it some arguments? If you supplied arguments, what did arguments did you pass? Also, your step 1 "Go to..." lists directory contents; it doesn't *go* there. Did you mean `cd` instead? – jamesdlin Sep 02 '19 at 19:29
  • Just run dartdoc from the main folder with NO arguments... – Paul L Sep 03 '19 at 08:15

1 Answers1

1

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

Imran Sefat
  • 528
  • 4
  • 6