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() {}
Otherwise, remove the annotation.
Was this page's content helpful?
Thank you for your feedback!
Provide details Thank you for your feedback! Please let us know what we can do to improve.
Provide details Unless stated otherwise, the documentation on this site reflects Dart 3.8.1. Page last updated on 2025-05-08. View source or report an issue.