WasmParseBackend class final
The web transport: comrak compiled to wasm32-unknown-unknown, loaded
through dart:js_interop alone, so it works under dart2js (Fleury) and
dart2wasm (Flutter web). Creation is asynchronous; parsing is synchronous.
wasm32 aborts on panic, so a native fault traps out of the call instead of returning a code. The trap is reported as FlarkParseException with FlarkParseException.faultCode, as the FFI transport reports a contained panic, under dart2js and dart2wasm alike, and the instance is discarded and re-created from the compiled module.
- Implemented types
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- schemaVersion → int
-
The render-model schema version the backend writes.
no setteroverride
Methods
-
dispose(
) → void -
Free the backend's memory now. Parsing afterwards throws a StateError;
a second call does nothing.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parse(
String source) → RenderModel -
Parse
sourceand return its render model. Invalid host text, a fail-closed extraction deviation, or a contained native fault surfaces as a FlarkParseException. A disposed backend throws a StateError.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
bundled(
) → Future< WasmParseBackend> - The package carries its own parser, including plain dart2js hosts and non-root deployments. Compile once, allocate a separate instance per owner.
-
defaultAssetCandidates(
) → List< Uri> -
Flutter web serves the package-declared asset at
assets/packages/flark/lib/assets/wasm/flark_parse.wasm; an app that declares it itself servesassets/packages/flark/assets/wasm/...; a plain page can place the module beside its HTML. -
fromBytes(
Uint8List bytes) → Future< WasmParseBackend> - Compile and instantiate from raw module bytes.
-
load(
{List< Uri> ? candidates}) → Future<WasmParseBackend> -
Fetch, compile, and instantiate. With no
candidates, tries the locations a Flutter web build and a plain dart2js page serve the package asset from; see defaultAssetCandidates.