Writer class Null safety

Manages a tree structure which we use to generate code.

Each leaf in the tree is a StringBuffer that contains some code. A Scope is a non-leaf node in the tree. Why are we doing this? Sometimes, we're in the middle of generating the implementation of a method and we realize we need to introduce another top-level class! When passing a single StringBuffer to the generators that will get ugly to manage, but when passing a Scope we will always be able to write code in a parent scope.

Constructors

Writer(MoorOptions options, {GenerationOptions generationOptions = const GenerationOptions()})

Properties

generationOptions GenerationOptions
final
hashCode int
The hash code for this object.
read-only, inherited
options → MoorOptions
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

child() Scope
leaf() StringBuffer
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
writeGenerated() String
Returns the code generated by this Writer.

Operators

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