正如开发文档所说,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);
}