Flutter Engine
The Flutter Engine
|
Classes | |
class | DartCallback |
class | DartEntrypoint |
interface | IsolateServiceIdListener |
Public Member Functions | |
DartExecutor (@NonNull FlutterJNI flutterJNI, @NonNull AssetManager assetManager) | |
void | onAttachedToJNI () |
void | onDetachedFromJNI () |
boolean | isExecutingDart () |
void | executeDartEntrypoint (@NonNull DartEntrypoint dartEntrypoint) |
void | executeDartEntrypoint ( @NonNull DartEntrypoint dartEntrypoint, @Nullable List< String > dartEntrypointArgs) |
void | executeDartCallback (@NonNull DartCallback dartCallback) |
BinaryMessenger | getBinaryMessenger () |
TaskQueue | makeBackgroundTaskQueue (TaskQueueOptions options) |
void | send (@NonNull String channel, @Nullable ByteBuffer message) |
void | send ( @NonNull String channel, @Nullable ByteBuffer message, @Nullable BinaryMessenger.BinaryReply callback) |
void | setMessageHandler ( @NonNull String channel, @Nullable BinaryMessenger.BinaryMessageHandler handler) |
void | setMessageHandler ( @NonNull String channel, @Nullable BinaryMessenger.BinaryMessageHandler handler, @Nullable TaskQueue taskQueue) |
void | enableBufferingIncomingMessages () |
void | disableBufferingIncomingMessages () |
int | getPendingChannelResponseCount () |
String | getIsolateServiceId () |
void | setIsolateServiceIdListener (@Nullable IsolateServiceIdListener listener) |
void | notifyLowMemoryWarning () |
Public Member Functions inherited from io.flutter.plugin.common.BinaryMessenger | |
default TaskQueue | makeBackgroundTaskQueue () |
default TaskQueue | makeBackgroundTaskQueue (TaskQueueOptions options) |
void | send (@NonNull String channel, @Nullable ByteBuffer message) |
void | send (@NonNull String channel, @Nullable ByteBuffer message, @Nullable BinaryReply callback) |
void | setMessageHandler (@NonNull String channel, @Nullable BinaryMessageHandler handler) |
default void | setMessageHandler ( @NonNull String channel, @Nullable BinaryMessageHandler handler, @Nullable TaskQueue taskQueue) |
default void | enableBufferingIncomingMessages () |
default void | disableBufferingIncomingMessages () |
Configures, bootstraps, and starts executing Dart code.
To specify a top-level Dart function to execute, use a DartEntrypoint
to tell DartExecutor
where to find the Dart code to execute, and which Dart function to use as the entrypoint. To execute the entrypoint, pass the DartEntrypoint
to executeDartEntrypoint(DartEntrypoint)
.
To specify a Dart callback to execute, use a DartCallback
. A given Dart callback must be registered with the Dart VM to be invoked by a DartExecutor
. To execute the callback, pass the DartCallback
to executeDartCallback(DartCallback)
.
Once started, a DartExecutor
cannot be stopped. The associated Dart code will execute until it completes, or until the io.flutter.embedding.engine.FlutterEngine
that owns this DartExecutor
is destroyed.
Definition at line 38 of file DartExecutor.java.
|
inline |
Definition at line 60 of file DartExecutor.java.
|
inline |
getBinaryMessenger()
instead. Implements io.flutter.plugin.common.BinaryMessenger.
Definition at line 250 of file DartExecutor.java.
|
inline |
getBinaryMessenger()
instead. Implements io.flutter.plugin.common.BinaryMessenger.
Definition at line 243 of file DartExecutor.java.
|
inline |
Starts executing Dart code based on the given dartCallback
.
See DartCallback
for configuration options.
dartCallback | specifies which Dart callback to run, and where to find it |
Definition at line 164 of file DartExecutor.java.
|
inline |
Starts executing Dart code based on the given dartEntrypoint
and the
.
dartEntrypointArgs
See DartEntrypoint
for configuration options.
dartEntrypoint | specifies which Dart function to run, and where to find it |
dartEntrypointArgs | Arguments passed as a list of string to Dart's entrypoint function. |
Definition at line 137 of file DartExecutor.java.
|
inline |
Starts executing Dart code based on the given dartEntrypoint
.
See DartEntrypoint
for configuration options.
dartEntrypoint | specifies which Dart function to run, and where to find it |
Definition at line 124 of file DartExecutor.java.
|
inline |
Returns a BinaryMessenger
that can be used to send messages to, and receive messages from, Dart code that this DartExecutor
is executing.
Definition at line 188 of file DartExecutor.java.
|
inline |
Returns an identifier for this executor's primary isolate. This identifier can be used in queries to the Dart service protocol.
Definition at line 279 of file DartExecutor.java.
|
inline |
Returns the number of pending channel callback replies.
When sending messages to the Flutter application using ByteBuffer, io.flutter.plugin.common.BinaryMessenger.BinaryReply)
, developers can optionally specify a reply callback if they expect a reply from the Flutter application.
This method tracks all the pending callbacks that are waiting for response, and is supposed to be called from the main thread (as other methods). Calling from a different thread could possibly capture an indeterministic internal state, so don't do it.
Currently, it's mainly useful for a testing framework like Espresso to determine whether all the async channel callbacks are handled and the app is idle.
Definition at line 270 of file DartExecutor.java.
|
inline |
Is this DartExecutor
currently executing Dart code?
Definition at line 113 of file DartExecutor.java.
|
inline |
getBinaryMessenger()
instead. Implements io.flutter.plugin.common.BinaryMessenger.
Definition at line 197 of file DartExecutor.java.
|
inline |
Notify the Dart VM of a low memory event, or that the application is in a state such that now is an appropriate time to free resources, such as going to the background.
This does not notify a Flutter application about memory pressure. For that, use the io.flutter.embedding.engine.systemchannels.SystemChannel#sendMemoryPressureWarning
.
Calling this method may cause jank or latency in the application. Avoid calling it during critical periods like application startup or periods of animation.
Definition at line 309 of file DartExecutor.java.
|
inline |
Invoked when the io.flutter.embedding.engine.FlutterEngine
that owns this DartExecutor
attaches to JNI.
When attached to JNI, this DartExecutor
begins handling 2-way communication to/from the Dart execution context. This communication is facilitate via 2 APIs:
BinaryMessenger
, which sends messages to Dart PlatformMessageHandler
, which receives messages from Dart Definition at line 85 of file DartExecutor.java.
|
inline |
Invoked when the io.flutter.embedding.engine.FlutterEngine
that owns this DartExecutor
detaches from JNI.
When detached from JNI, this DartExecutor
stops handling 2-way communication to/from the Dart execution context.
Definition at line 100 of file DartExecutor.java.
|
inline |
getBinaryMessenger()
instead. Definition at line 213 of file DartExecutor.java.
|
inline |
getBinaryMessenger()
instead. Implements io.flutter.plugin.common.BinaryMessenger.
Definition at line 205 of file DartExecutor.java.
|
inline |
Set a listener that will be notified when an isolate identifier is available for this executor's primary isolate.
Definition at line 292 of file DartExecutor.java.
|
inline |
getBinaryMessenger()
instead. Definition at line 224 of file DartExecutor.java.
|
inline |
getBinaryMessenger()
instead. Definition at line 233 of file DartExecutor.java.