正如开发文档所说,Dart doesn't have the keywords public , protected , and private . If an identifier starts with an underscore (_), it's private to its library.
但是我发现很多@protected
Flutter 框架中的关键字。 @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 分析器在子类之外使用成员时提供提示。
您可以找到问题here .
关于flutter - @protected 在 dart 中是什么意思,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61810306/