undefined_annotation
Undefined name '{0}' used as an annotation.
Description
#The analyzer produces this diagnostic when a name that isn't defined is used as an annotation.
Example
#The following code produces this diagnostic because the name undefined
isn't defined:
dart
@undefined
void f() {}
Common fixes
#If the name is correct, but it isn't declared yet, then declare the name as a constant value:
dart
const undefined = 'undefined';
@undefined
void f() {}
If the name is wrong, replace the name with the name of a valid constant:
dart
@deprecated
void f() {}
除非另有说明,文档之所提及适用于 Dart 3.7.3 版本,本页面最后更新时间: 2025-05-08。 查看文档源码 或者 报告页面问题。