AnalyzerBuffer.newLibrary constructor
Creates a AnalyzerBuffer that generates a brand new library.
When writing types, AnalyzerBuffer will automatically add the necessary imports to the generated code.
packageName is the name of the package where the generated file will be located.
path is the path of the generated file, relative to the package root (e.g. lib/src/file.dart).
Implementation
AnalyzerBuffer.newLibrary({
required String packageName,
required String path,
this.header,
}) : _generatedFile = _GeneratedFileLocation(
packageName: packageName,
path: path,
),
_namespace = _TargetNamespace.empty(
generatedFile: _GeneratedFileLocation(
packageName: packageName,
path: path,
),
),
_autoImport = true;