flutter_qjs library
Classes
- FlutterJsPlatformEmpty
- FlutterQjsLogger
- IsolateFunction
- Dart function wrapper for isolate
- IsolateQjs
- JavascriptRuntime
- JsEnginePool
- Bounded pool of JavascriptRuntime instances for multi-engine workloads.
- JsEnginePoolConfig
- Configuration for engines created by JsEnginePool.
- JSError
- JS Error wrapper
- JSEvalFlag
- JsEvalResult
- JsFetchOptions
-
Network access for JS
fetch. Passing this to JsWebApis enables the globalfetchand installs the modules it requires. This object, not the module set, is the network policy: see allowUrl. - JsFetchRequest
-
One HTTP exchange requested by JS
fetch. - JsFetchResponse
- Result of a JsFetchHandler call.
- JSInvokable
- js invokable
- JsMemoryUsage
-
Snapshot of QuickJS
JSMemoryUsagefields used for monitoring. - JsModuleBundle
- A set of ES modules compiled to QuickJS bytecode ahead of time.
- JSRef
- JsTypedArrayTransfer
- A native buffer whose ownership can be transferred to a QuickJS TypedArray.
- JSTypedArrayType
- JSTypedArrayEnum values (order matches quickjs.h).
- JsWebApis
- Web platform APIs a runtime installs into each JS context.
- JsWebModule
- One independently installable unit of the Web platform API.
- NativeHeapUsage
- C heap accounting: what the allocator holds vs what is actually live.
- QuickJsRuntime2
- Quickjs engine for flutter.
Enums
- EngineResetMode
- How JsEnginePool prepares an engine for the next lease on JsEnginePool.release.
- FlutterQjsLogLevel
Extensions
- HandlePromises on JavascriptRuntime
- Promise handling without Timer.periodic polling of JS query helpers.
Constants
- kDefaultJsMemoryLimit → const int
- Default QuickJS heap limit for all runtime construction paths.
Functions
-
getJavascriptRuntime(
{bool forceJavascriptCoreOnAndroid = false, bool xhr = true, Map< String, dynamic> ? extraArgs = const {}, int stackSize = 1024 * 1024, int? timeout, int? memoryLimit = kDefaultJsMemoryLimit, JsWebApis webApis = const JsWebApis()}) → JavascriptRuntime - Creates a JavascriptRuntime backed by QuickJS.
-
normalizeJsMemoryLimit(
int? value) → int - Resolves the public memory-limit contract: zero is unlimited, while null and negative values fall back to the safe default.
-
readBridgeStats(
) → Map< String, int> -
readNativeHeapUsage(
) → NativeHeapUsage - Snapshot of NativeHeapUsage for the whole process.
-
trimNativeHeap(
) → bool -
Ask the C allocator to return free pages to the OS, and report whether it
released anything. Unsupported allocators return
false.
Typedefs
- FlutterQjsLogHandler = void Function(FlutterQjsLogLevel level, String message, Object? error)
-
JsFetchHandler
= Future<
JsFetchResponse> Function(JsFetchRequest request) -
Performs a single HTTP exchange for JS
fetch.