gpt4 book ai didi

flutter - Doc注释和Dart注释之间的区别

转载 作者:行者123 更新时间:2023-12-03 03:35:57 28 4
gpt4 key购买 nike

也许看起来很简单,但我对了解Doc Comments和Dart中Comments之间的确切区别感兴趣。

/// 这是一个文档评论

// 这是一个评论

我认为,在此处提问和回答也可能对其他人有帮助:)

最佳答案

评论(//)
注释通常用于注释代码的某些部分或在代码中添加一些注释,您希望与团队成员进行交流。

文档评论(///)
Doc注释用于文档目的。 dartdoc解析文档注释并创建文档页面。

+--------------------------------------------+-----------------------------------------------------+
| Comments | Doc Comments |
+--------------------------------------------+-----------------------------------------------------+
| - Comment out some part of your code | - Anything that you want to document using dartdoc |
| - Private APIs | - Usually used for public API/Framework/Library |
| - Private variable declaration | |
| - Method implementation logic | |
| - Something you need to do in future | |
| for improvements or cleanup purpose etc | |
+--------------------------------------------+-----------------------------------------------------+

您可以在 Effective Dart - Documentation中了解更多有关这些的信息

关于flutter - Doc注释和Dart注释之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61160343/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com