作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在整个 Flutter 仓库中看到过如下片段:
/// {@macro flutter.widgets.editableText.readOnly}
在 IDE 和渲染的 Dart 文档中,它是
shown like this :
Whether the text can be changed.
When this is set to true, the text cannot be modified by any shortcut or keyboard operation. The text is still selectable.
Defaults to false. Must not be null.
最佳答案
您可以创建 模板并将它们用作 宏 使用 dartdoc
,这是 Flutter 自带的默认 API 文档包。
只需定义一个 @template
在您的文档中的任何位置:
/// {@template template_name}
/// Some shared docs
/// {@endtemplate}
现在,您可以在其他任何地方重用它:
/// Some comment
/// {@macro template_name}
/// More comments
Learn more .
关于flutter - 如何在 Dart 和 Flutter 中创建 DartDoc 宏/模板?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62763658/
我是一名优秀的程序员,十分优秀!