本文介绍了禁止使用受保护成员的提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
套件提供 @protected $ c $
The meta package provides a @protected
annotation (besides others) to get analyzer hints or warnings about the use of protected members outside of direct subclasses.
如何禁止这些提示?
推荐答案
@protected
提示的抑制代码为 INVALID_USE_OF_PROTECTED_MEMBER
。添加抑制评论,如:
The suppression code for the @protected
hint is INVALID_USE_OF_PROTECTED_MEMBER
. Add a suppression comment like:
// ignore: INVALID_USE_OF_PROTECTED_MEMBER
app.quickNav.keyDownHandler(ctrlKeyDown);
其他提示的代码可在
- https://github.com/dart-lang/sdk/blob/master/pkg/analyzer/lib/src/error/codes.dart
- https://github.com/dart-lang/sdk/blob/master/pkg/analyzer/lib/src/dart/error/hint_codes.dart
- https://github.com/dart-lang/sdk/blob/master/pkg/analyzer/lib/src/dart/error/lint_codes.dart
这适用于 Dart VM版本:1.16.0-edge
。我不知道这个发布的版本。
This works with Dart VM version: 1.16.0-edge
. I don't know with what version this was released.
希望这些ID将成为警告的一部分,很快就不必查找。
Hopefully these IDs will be part of the warnings soon to not have to look them up.
这篇关于禁止使用受保护成员的提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!