addImportsTo method
Adds dependencies of generate to imports
.
For each .pb.dart file that the generated code needs to import, add its generator.
Implementation
void addImportsTo(
Set<FileGenerator> imports, Set<FileGenerator> enumImports) {
if (!_resolved) throw StateError('resolve not called');
final typeGen = _field.baseType.generator;
if (typeGen is EnumGenerator) {
// Enums are always in a different file.
enumImports.add(typeGen.fileGen!);
} else if (typeGen != null && typeGen.fileGen != fileGen) {
imports.add(typeGen.fileGen!);
}
}