CodeUnit class

A model of a generated Dart source file, containing zero or more classes.

Useful for testing that a generator produces the expected class structure without relying on rendered string output.

Annotations
  • @immutable

Constructors

CodeUnit({required List<CodeClass> classes})
Creates a code unit with the given classes.
const

Properties

classes List<CodeClass>
Ordered list of class declarations to emit into the file.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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