作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
Dart Language Tour涵盖文档注释,并说:
Inside a documentation comment, the Dart compiler ignores all text unless it is enclosed in brackets. Using brackets, you can refer to classes, methods, fields, top-level variables, functions, and parameters. The names in brackets are resolved in the lexical scope of the documented program element.
/// # Thingy
///
/// Blah [GLOBAL] blah [function] blah [Thingy] blah [Thingy.property] blah
/// [Thingy.virtualProperty] blah [Thingy.named] blah [Thingy.method]
/// blah [Thingy.operator+].
/// Try these: [Thingy.named()] blah [Thingy.()] blah [Thingy()].
library Thingy;
const int GLOBAL = 0;
void function(int arg) {}
/// A class.
///
/// Blah [GLOBAL] blah [function] blah [Thingy] blah [property] blah
/// [virtualProperty] blah [named] blah [method] blah [operator+].
/// Try these: [Thingy.named()] blah [Thingy.()] blah [Thingy()].
class Thingy {
int property;
int get virtualProperty => 0;
set virtualProperty(int arg) {}
Thingy(int arg) {}
Thingy.named(int arg) {}
/// A method.
///
/// Blah [GLOBAL] blah [function] blah [Thingy] blah [property] blah
/// [virtualProperty] blah [named] blah [method] blah [operator+] blah
/// [arg].
/// Try these: [Thingy.named()] blah [Thingy.()] blah [Thingy()].
void method(int arg) {}
Thingy operator+(int arg) => null;
}
Blah GLOBAL blah function blah Thingy blah property blah virtualProperty blah
named
blah method blahoperator+
...Try these:
Thingy.named
blahThingy.()
blahThingy()
.
最佳答案
构造函数指的是 new
/// [new MyClass]
/// [new MyClass.someNamedConstructor]
/// [operator ==] or [==] seem not to work
关于dart - 如何在 dartdoc 中引用构造函数和运算符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34907717/
我是一名优秀的程序员,十分优秀!