prefix_identifier_not_followed_by_dot
名稱“{0}”引用了一個匯入字首,因此其後必須緊跟“.”。
描述
#當匯入字首被單獨使用,而未訪問與該字首關聯的庫中宣告的任何名稱時,分析器會產生此診斷資訊。字首不是變數,因此不能用作值。
示例
#以下程式碼會產生此診斷資訊,因為字首 math 被當作變數使用
dart
import 'dart:math' as math;
void f() {
print(math);
}常見修復方法
#如果程式碼不完整,請引用與該字首關聯的某個庫中的內容
dart
import 'dart:math' as math;
void f() {
print(math.pi);
}如果名稱錯誤,請更正名稱。