简体   繁体   中英

what does @protected mean in dart

As the dev doc says, 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. But I found many @protected keywords in Flutter framework. What does the @protected mean?

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);
}

It's used to provide a hint when members are used outside of subclasses, by the Dart Analyzer.

You can find the issue here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM