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