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:
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:
import 'dart:math' as math;
void f() {
print(math.pi);
}
If the name is wrong, then correct the name.
Unless stated otherwise, the documentation on this site reflects Dart 3.7.3. Page last updated on 2025-05-08. View source or report an issue.