prefix_identifier_not_followed_by_dot
The name '{0}' refers to an import prefix, so it must be followed by '.'.
Description
#The analyzer produces this diagnostic when an import prefix is used by itself, without accessing any of the names declared in the libraries associated with the prefix. Prefixes aren't variables, and therefore can't be used as a value.
Example
#The following code produces this diagnostic because the prefix math
is
being used as if it were a variable:
dart
import 'dart:math' as math;
void f() {
print(math);
}
Common fixes
#If the code is incomplete, then reference something in one of the libraries associated with the prefix:
dart
import 'dart:math' as math;
void f() {
print(math.pi);
}
除非另有说明,文档之所提及适用于 Dart 3.7.3 版本,本页面最后更新时间: 2025-05-08。 查看文档源码 或者 报告页面问题。