dart_eval library
A library providing a Dart bytecode compiler and interpreter.
Classes
Enums
- DiagnosticMode
- Defines the diagnostic modes for the dart_eval compiler. These modes control how the compiler handles parsing diagnostics, such as errors, warnings, and informational messages.
Properties
- globalRuntime ↔ Runtime?
-
The global runtime instance to be used for overrides
getter/setter pair
-
runtimeOverrides
↔ Map<
String, OverrideSpec> ? -
Mapping of runtime overrides, which can be used to dynamically swap
implementations of functions at runtime by a unique ID
getter/setter pair
- runtimeOverrideVersion ↔ Version?
-
The current semver Version of your app. Overriden functions can specify
a version constraint in their @RuntimeOverride annotation which will be
checked against this version to determine if the override should apply.
getter/setter pair
Functions
-
eval(
String source, {String function = 'main', List args = const [], List< EvalPlugin> plugins = const [], List<Permission> permissions = const [], String? outputFile}) → dynamic -
Evaluate the Dart
sourcecode. If the source is a raw expression such as "2 + 2" it will be evaluated directly and the result will be returned; otherwise, the functionfunctionwill be called with arguments specified byargs. You can usepluginsto configure bridge classes andpermissionsto grant permissions to the runtime. You can also specifyoutputFileto write the generated EVC bytecode to a file.