CodegenMixin mixin

Mixin applications

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

assign(String name, String value) → void
Generates an assignment statement.
break$([String? label]) → void
Generates a break statement.
capture(int indentLevel, void f()) String
Redirects subsequent code generation into a temporary buffer.
clearSource() → void
Clears the underlying buffer and resets the indentation level.
closeBlock([String closeFooter = '}']) → void
Closes the innermost block and decreases indentation.
continue$([String? label]) → void
Generates a continue statement.
declare(String name, Object? value, {bool isConst = false, bool isFinal = true, String? type}) → void
Declares a variable.
decrement(String name, int value) → void
Decrements a variable by a specific value.
else$() → void
Generates an else clause.
elseIf(String condition) → void
Generates an else if clause.
getSource() String
Returns the source code.
increment(String name, int value) → void
Increments a variable by a specific value.
isNotNull(String expression) String
Returns a non-null-check expression string.
isNull(String expression) String
Returns a null-check expression string.
label$(String label) → void
Generates a label.
nextBranch([String? condition]) → void
Switches branches linearly by shifting the indent back and forth.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openBlock([String openHeader = '{']) → void
Opens a block and immediately increases indentation.
openFunction({required String name, String modifier = '', String returnType = 'void', List<(String, String)> positional = const [], List<(String, String, String?)> named = const []}) → void
Opens a function/method block with arguments.
openIf(String condition) → void
Opens an if statement.
openWhile(String condition) → void
Opens a while statement.
reopenBlock(String newHeader) → void
return$([String? value]) → void
Generates a return statement.
stmt(String code) → void
Generates a statement terminated by a semicolon.
ternary$(String condition, Object ifValue, Object elseValue) String
Generates a ternary conditional expression: condition ? ifValue : elseValue.
toString() String
A string representation of this object.
inherited
writeln(Object object) → void
Safely writes both single-line and multi-line strings.
writeRawString(String string) → void
Writes a string without checking the contents.

Operators

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