Skip to content

dartdoc comment references

jcollins-g edited this page Jun 22, 2018 · 10 revisions

Dartdoc comment references

Comment references are wrapped in brackets within comments preceding classes, library declarations, member variables/functions, and so forth. They are resolved first to parameters for the function (though not linked), then to their enclosing class and library.

General notes

  • Type parameters, parentheses, and a leading "new " will be ignored

Examples

  • Default constructor: [MyClass.MyClass]
  • Named constructors: [MyClass.namedConstructor]
  • From a class with a conflicting member name, the top-level variable of the same name in that library:
library myLib;
final String myString = "hi";

class A {
  final String myString = "there";

  /// The lovely [A] class's [foo] method.
  /// [myString] - refers to A.myString
  /// [myLib.myString] - refers to the top level myString
  void foo() {}
}
Clone this wiki locally