ImportWriter class

A utility class to generate a set of imports. The imports will be grouped by kind (dart: imports, package: imports, ...) and sorted lexically within the groups.

Constructors

ImportWriter()

Properties

hashCode int
The hash code for this object.
no setterinherited
hasImports bool
Whether any imports were written.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addExport(String url) → void
And an export.
addImport(String url, {String? prefix}) → void
Add an import with an optional import prefix.
emit() String
Return the generated text for the set of imports.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited