Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter/Dart Formatting for in-line Documentation Comments?

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?

like image 938
Xenoranger Avatar asked Nov 07 '25 01:11

Xenoranger


1 Answers

Dartdoc uses Markdown, so you can use most typical Markdown formatting in Dartdoc comments.

like image 180
jamesdlin Avatar answered Nov 09 '25 18:11

jamesdlin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!