【问题标题】:what does @protected mean in dart@protected 在飞镖中是什么意思
【发布时间】:2020-08-31 18:02:48
【问题描述】:

正如开发文档所说,Dart doesn't have the keywords public , protected , and private . If an identifier starts with an underscore (_), it's private to its library. 但我在 Flutter 框架中发现了很多 @protected 关键字。 @protected 是什么意思?

abstract class InheritedWidget extends ProxyWidget {
  const InheritedWidget({ Key key, Widget child })
    : super(key: key, child: child);

  @override
  InheritedElement createElement() => InheritedElement(this);

  @protected
  bool updateShouldNotify(covariant InheritedWidget oldWidget);
}

【问题讨论】:

  • @protectedpackage:meta 提供的注释(而不是语言关键字),供dartanalyzer 使用。

标签: flutter dart protected


【解决方案1】:

当成员在子类之外被 Dart Analyzer 使用时,它用于提供提示。

你可以找到问题here

【讨论】:

    猜你喜欢
    • 2020-08-15
    • 1970-01-01
    • 2012-04-21
    • 1970-01-01
    • 2021-02-16
    • 2019-06-11
    • 2015-12-14
    • 2011-08-12
    • 2017-06-11
    相关资源
    最近更新 更多