【问题标题】:Dart - Mark as Deprecated DocumentationDart - 标记为已弃用的文档
【发布时间】:2020-06-27 17:07:58
【问题描述】:

我在我的实现中更改了一些内容,我想将一些类标记为已弃用,以便它们将使用新的实现。

如何在 dart 中将一个类标记为已弃用?目前,我只将其记录为已弃用,而没有实际标记该类或将其划掉。

/// Throws a BadRequestException - 400
class BadRequestException implements Exception {}
/// Throws a NotFoundException - 404
class NotFoundException implements Exception {}
/// Throws a ConflictException - 409
class ConflictException implements Exception {}
/// [DEPRECATED]
/// Don't use this anymore, this is deprecated.
class AlreadyExistsException implements Exception {}

【问题讨论】:

    标签: dart code-documentation


    【解决方案1】:

    找到了。 Deprecated Classes

    @Deprecated('Use [ConflictException]')
    class AlreadyExistsException implements Exception {}
    

    【讨论】:

      猜你喜欢
      • 2010-09-22
      • 1970-01-01
      • 2014-08-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-09-22
      相关资源
      最近更新 更多