DartEncoder class
Encodes Dart source code into a ball Program.
Constructors
- DartEncoder({bool strict = false})
- Creates a new encoder.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- strict → bool
-
When true, malformed metadata causes an EncoderError.
final
-
warnings
→ List<
String> -
Warnings emitted during encoding (permissive mode only).
final
Methods
-
buildStdModules(
) → ({Module? collectionsModule, Module? protoModule, Module stdModule}) -
Build consolidated std
Modules from all base functions accumulated since the last encode call or manual clearStdAccumulator. -
clearStdAccumulator(
) → void - Clear the accumulated set of used base functions.
-
encode(
String source, {String name = 'encoded', String version = '1.0.0', String partResolver(String uri)?}) → Program - Encode Dart source into a ball program.
-
encodeModule(
String source, {required String moduleName, Map< String, String> uriToModuleOverrides = const {}}) → ({List<Module> importStubs, Module module}) -
Encode Dart source into a single ball
Module, accumulating used base-function names for later use by buildStdModules. -
encodeModuleFromUnit(
CompilationUnit unit, {required String moduleName, Map< String, String> uriToModuleOverrides = const {}}) → ({List<Module> importStubs, Module module}) -
Variant of encodeModule that accepts a pre-parsed
ast.CompilationUnit. -
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
Static Methods
-
uriToModuleName(
String uri) → String