DartBridge class
Loaded dart_bridge symbols. Use DartBridge.instance for the default per-platform handle, or DartBridge.open / DartBridge.process to load from a specific source (mostly useful for tests).
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isPythonInitialized → bool
-
True if libdart_bridge has already brought up an embedded CPython.
On Android process reuse (OS keeps the process alive across a Dart
VM restart), this returns true on the second Dart VM's PythonBridge
construction.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
enqueueMessage(
int port, Pointer< Uint8> data, int len) → int -
Deliver bytes to the Python handler registered for
port. Returns 0 on successful delivery, -1 if no handler is registered (caller may retry), or -2 if the interpreter is not initialized. -
initDartApiDL(
) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
run(
Pointer< SpRunConfig> cfg) → int -
Run a Python program (
appPathmode) or source string (scriptmode). SeeSpRunConfig/serious_python_run. -
signalDartSession(
Map< String, int> portMap) → void -
Signal the running Python program that a new Dart VM session is
active. On a fresh start where Python isn't loaded yet, this is a
cheap no-op inside libdart_bridge. On Android process reuse it fires
every Python callback registered via
dart_bridge.add_session_restart_handler(...), carrying the new native port numbers as a{label: port}map. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → DartBridge
-
Default per-platform loader. Cached after the first call.
no setter
Static Methods
-
open(
String path) → DartBridge - Test/override entry point: open a specific library path. Replaces the cached instance.
-
process(
) → DartBridge - Test/override entry point: resolve from the host process (Apple). Replaces the cached instance.