【问题标题】:dart show documentation from another method in another filedart 在另一个文件中显示来自另一个方法的文档
【发布时间】:2021-12-03 19:11:24
【问题描述】:

是否可以在驻留在不同文件中的另一个函数的文档中显示一个函数的文档?宏只在自己的文件中有效。

在Flutter源码中,他们使用了这样的东西,但似乎没有任何作用:

/// {@macro flutter.widgets.editableText.keyboardType}

【问题讨论】:

    标签: dart dartdoc


    【解决方案1】:

    你能做的最好的就是链接到引用的函数。

    file_a.dart

    /// Also see [functionB].
    void functionA() {}
    

    file_b.dart

    /// Another function.
    void functionB() {}
    

    https://dart.dev/guides/language/language-tour#documentation-comments

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-09-09
      • 2020-10-14
      • 1970-01-01
      • 1970-01-01
      • 2011-10-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多