invalid_ use_ of_ do_ not_ submit_ member
Details about the 'invalid_use_of_do_not_submit_member' diagnostic produced by the Dart analyzer.
Uses of '{0}' should not be submitted to source control.
Description
#
The analyzer produces this diagnostic when a member that is
annotated with
@doNotSubmit
is referenced outside of a member declaration that is also
annotated with @doNotSubmit.
Example
#
Given a file a.dart containing the following
declaration:
import 'package:meta/meta.dart';
@doNotSubmit
void emulateCrash() { /* ... */ }
The following code produces this diagnostic because the
declaration is being referenced outside of a member that is
also annotated with
@doNotSubmit:
import 'a.dart';
void f() {
emulateCrash();
}
Common fixes
#Most commonly, when complete with local testing, the reference to the member should be removed.
If building additional functionality on top of the member,
annotate the newly added member with
@doNotSubmit as well:
import 'package:meta/meta.dart';
import 'a.dart';
@doNotSubmit
void emulateCrashWithOtherFunctionality() {
emulateCrash();
// do other things.
}
除非另有说明,文档之所提及适用于 Dart 3.12.2 版本报告页面问题.