VM class

Constructors

VM({bool enableInlineCaching = true})
Constructor - initializes standard library

Properties

cacheStats → Map<String, dynamic>
Get current inline cache stats for debugging
no setter
coroutineResumeCallback ↔ CoroutineResumeCallback?
getter/setter pair
debugger ↔ FluxDebugger?
getter/setter pair
enableInlineCaching → bool
final
frames → List<CallFrame>
Get current call frames
no setter
globals → Map<String, Object?>
Access to global variables (for FluxRuntime integration)
no setter
hashCode → int
The hash code for this object.
no setterinherited
imports → List<String>
Get list of imports encountered during execution
no setter
isAwaiting → bool
no setter
onHotSwap ↔ void Function(String scriptName)?
Callback triggered after a hot swap is applied
getter/setter pair
onPrint ↔ void Function(String message)
Basic output handler
getter/setter pair
onStateChange ↔ void Function(String name, Object? value)?
Callback triggered when setState is called (for Flutter rebuild)
getter/setter pair
pendingFuture → Future?
Get the pending Future (for external await handling)
no setter
profiler ↔ FluxProfiler?
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
stack → List<Object?>
Get current execution stack
no setter
widgetCallHandler ↔ WidgetCallHandler?
Optional widget call handler for FluxRuntime
getter/setter pair
widgetState → Map<String, Object?>
Access to widget state for FluxRuntime
no setter

Methods

clearState() → void
Clear state (for new widget instance)
executeClosure(ObjClosure closure, [List<Object?> args = const []]) → InterpretResult
Execute a closure with arguments. Used by FluxRuntime to execute widget builder closures.
executeFunctionInContext(CompiledFunction function, List<Object?> locals) → Object?
Execute a compiled function/expression in a specific context (isolated)
getScript(String name) → CompiledFunction?
Get a registered script by name
hotSwap(String scriptName, CompiledFunction newFunction) → void
Hot-swap a script with a new compiled function
initializeState(CompiledWidget widget) → void
Initialize widget state from CompiledWidget
interpret(String source) → InterpretResult
Interpret source code
invokeClosure(ObjClosure closure, [List<Object?> args = const []]) → InterpretResult
Execute a closure synchronously on the current stack/coroutine. Used for callbacks that must happen within the same execution context (e.g. nested widget builds).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerModule(FluxModule module) → void
Register a custom module with the VM (e.g., http, storage)
registerScript(String name, CompiledFunction function) → void
Register a compiled script for potential hot-swap
resume() → InterpretResult
resumeCoroutine(FluxCoroutine coroutine, Object? result) → InterpretResult
Resume a suspended coroutine with the await result
resumeCoroutineWithError(FluxCoroutine coroutine, Object error) → InterpretResult
Resume a suspended coroutine with an error Resume a suspended coroutine with an error
resumeFromAwait(Object? result) → InterpretResult
Resume execution after an awaited Future completes
runChunk(Chunk chunk) → InterpretResult
Run a pre-compiled chunk directly
suspendToCoroutine() → FluxCoroutine
Suspend current execution and create a coroutine snapshot
toString() → String
A string representation of this object.
inherited

Operators

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