undefined_identifier
Undefined name '{0}'.
Description
#The analyzer produces this diagnostic when it encounters an identifier that either isn't defined or isn't visible in the scope in which it's being referenced.
Example
#The following code produces this diagnostic because the name rihgt
isn't
defined:
dart
int min(int left, int right) => left <= rihgt ? left : right;
Common fixes
#If the identifier isn't defined, then either define it or replace it with an identifier that is defined. The example above can be corrected by fixing the spelling of the variable:
dart
int min(int left, int right) => left <= right ? left : right;
除非另有说明,文档之所提及适用于 Dart 3.7.3 版本,本页面最后更新时间: 2025-05-08。 查看文档源码 或者 报告页面问题。