Allocator class Null safety

Collects references and automatically allocates prefixes and imports.

Allocator takes out the manual work of deciding whether a symbol will clash with other imports in your generated code, or what imports are needed to resolve all symbols in your generated code.

Constructors

Allocator()
Creates a new default allocator that applies no prefixing.
factory
Allocator.simplePrefixing()
Creates a new allocator that applies naive prefixing to avoid conflicts. [...]
factory

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
imports Iterable<Directive>
All imports that have so far been added implicitly via allocate.
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

allocate(Reference reference) String
Returns a reference string given a reference object. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

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

Constants

none → const Allocator
An allocator that does not prefix symbols nor collects imports.
_NullAllocator()