[英]what does @protected mean in dart
正如开发文档所说, Dart doesn't have the keywords public, protected, and private. If an identifier starts with an underscore (_), it's private to its library.
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);
}
当 Dart Analyzer 在子类之外使用成员时,它用于提供提示。
你可以在这里找到问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.