Here's an example of what I'm trying to accomplish.
/// This is a doc string for this method.
method1(){}
@method1DocString
////method 2 doc string added to method1's here.
method2(){}
So method2's documentation would be:
This is a doc string for this method.
method 2 doc string added to method1's here.
I'm fairly certain I've seen this done before. Saves having to rewrite documentation where applicable. Also makes it easier to maintain accurate documentation.
What is the correct syntax for this in dart ?
This does exactly what I was looking for, thanks to @pskink:
/// {@template method1_documentation}
/// This is a doc string for this method.
/// {@endtemplate}
method1(){}
/// {@macro method1_documentation}
/// method 2 doc string added to method1's here.
method2(){}
In the documentation: https://pub.dev/packages/dartdoc#macros