With dart it is possible to prefix class/function definition by a commentary so that the analyzer will interpret it as documentation:
/// Some documentation for [Foo]
class Foo {
}
But how can I achieve the same behavior, with parameters instead?
I tried the following:
void myFunction(
/// Some parameter documentation
String parameter,
) {
}
But this doesn't work.
However, it seems possible because dartanalyzer
do contain a property on ParameterElement
for documentation.
https://www.dartlang.org/guides/language/effective-dart/documentation
Here's the offical Dart language guidelines for documentation best practice. It covers most/all cases and has great examples of do's and don't's.
This bit shows the way to include parameters. Basically, wrap the parameters in square brackets and within a sentence explaining it.
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