what does @protected mean in dart

3,936

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

You can find the issue here.

Share:
3,936
Yvan
Author by

Yvan

Updated on December 20, 2022

Comments

  • Yvan
    Yvan over 1 year

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