skip to Main Content

Are there additional formatting options for Flutter/Dart in-line documentation?

I’m using Android Studio. I prefer to leave detailed comments so I don’t have to spend time looking through code to figure out why a specific class or method was used. In C#, I use the triple-slash (///) with to add in-line documentation. I know Dart uses the triple-slash as well, but slightly differently than C#. For instance, Dart doesn’t support the Summary, Para, nor Param tags.

From what I have found, Dart uses the following:

Of course, triple-slash (///) is a basic in-line documentation comment

/// My Documentation Comment

I’ve found that you can use plus (+) or minus (-) to indicate an item in a bulleted list:

/// - Bullet List Item 1
/// + Bullet List Item 2

You can also use Hash (#) for emphasizing a line.

/// # This Line will be Emphasized

Lastly, it supports the BR tag for new line in comments.

/// This is line 1 
/// This will also appear on line 1
/// <br /> This will appear on line 2

Apart from these 4, are there any other formatting options that can be performed when working with in-line documentation in Dart?

2

Answers


  1. Use TODO in Comments.
    The TODO will make it highlight and accessible

    ///TODO:something in comment
    

    This works fine with android studio

    Login or Signup to reply.
  2. Dartdoc uses Markdown, so you can use most typical Markdown formatting in Dartdoc comments.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search