invalid_use_of_do_not_submit_member
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.7.3 版本,本页面最后更新时间: 2025-05-08。 查看文档源码 或者 报告页面问题。