flutter - @protected 在 dart 中是什么意思

标签 flutter dart protected

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

相关文章:

java - 为什么我不能直接在子类中使用可重入类的 getOwner() 方法?

php - 如何调用 protected 函数?

c++ - 无法访问派生类中的 protected 类成员

android - Navigator.push() 永远循环

flutter - 如何在 flutter 中用平移、倾斜和缩放值填充 Matrix4?

widget - 将文本小部件相互环绕

firebase - Cloud FireStore使用相同的iD作为用户UID的多个文档

user-interface - Flutter - 如何在 SimpleDialog 框中显示 GridView?

android - Flutter:适用于 Windows 的 iOS 模拟器

flutter - build.yaml 中是否有 build_extensions 规则将所有生成的 Flutter 模型输出到公共(public)目录中?