uri_has_not_been_generated
Target of URI hasn't been generated: '{0}'.
Description
#The analyzer produces this diagnostic when an import, export, or part directive is found where the URI refers to a file that doesn't exist and the name of the file ends with a pattern that's commonly produced by code generators, such as one of the following:
.g.dart
.pb.dart
.pbenum.dart
.pbserver.dart
.pbjson.dart
.template.dart
Example
#If the file lib.g.dart
doesn't exist, the following code produces this
diagnostic:
dart
import 'lib.g.dart';
Common fixes
#If the file is a generated file, then run the generator that generates the file.
除非另有说明,文档之所提及适用于 Dart 3.7.3 版本,本页面最后更新时间: 2025-05-08。 查看文档源码 或者 报告页面问题。