dart api划掉了变量

时间:2016-02-13 23:10:17

标签: api sdk dart

在大多数Dart文档页面中,一些变量和函数被划掉。比如https://api.dartlang.org/1.14.2/dart-js/dart-js-library.html

这意味着什么?

2 个答案:

答案 0 :(得分:2)

它表示类,函数,属性等是deprecated

在Dart中,注释用于将某些内容标记为已弃用。请注意this class上记录的注释。

答案 1 :(得分:2)

在Dart metadata中可以添加到类,字段,库声明,参数......作为注释。

@Deprecated('some reason')
class SomeClass {
  String someField;
  int otherField;

  SomeClass({
      this.someField, 
      @Deprecated('don\'t use this anymore") this.otherField});
}

是这样的注释,并且像Dart分析器和dartdoc这样的工具使用这些信息来产生警告(Analyzer)或其他视觉提示,某些API仍然存在但应该避免,因为它计划最终被删除。