Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,14 @@
*
* <p>The following illustrates how to pre-warm and cache a {@link FlutterEngine}:
*
* <p>{@code // Create and pre-warm a FlutterEngine. FlutterEngine flutterEngine = new
* FlutterEngine(context); flutterEngine .getDartExecutor()
* .executeDartEntrypoint(DartEntrypoint.createDefault());
*
* <p>// Cache the pre-warmed FlutterEngine in the FlutterEngineCache.
* FlutterEngineCache.getInstance().put("my_engine", flutterEngine); }
* <pre>{@code
* // Create and pre-warm a FlutterEngine.
* FlutterEngine flutterEngine = new FlutterEngine(context);
* flutterEngine.getDartExecutor().executeDartEntrypoint(DartEntrypoint.createDefault());
*
* // Cache the pre-warmed FlutterEngine in the FlutterEngineCache.
* FlutterEngineCache.getInstance().put("my_engine", flutterEngine);
* }</pre>
*
* <p><strong>Alternatives to FlutterActivity</strong>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,14 @@
*
* <p>The following illustrates how to pre-warm and cache a {@link FlutterEngine}:
*
* <p>{@code // Create and pre-warm a FlutterEngine. FlutterEngine flutterEngine = new
* FlutterEngine(context); flutterEngine .getDartExecutor()
* .executeDartEntrypoint(DartEntrypoint.createDefault());
* <pre>{@code
* // Create and pre-warm a FlutterEngine. FlutterEngine flutterEngine = new
* FlutterEngine(context);
* flutterEngine.getDartExecutor().executeDartEntrypoint(DartEntrypoint.createDefault());
*
* <p>// Cache the pre-warmed FlutterEngine in the FlutterEngineCache.
* FlutterEngineCache.getInstance().put("my_engine", flutterEngine); }
* // Cache the pre-warmed FlutterEngine in the FlutterEngineCache.
* FlutterEngineCache.getInstance().put("my_engine", flutterEngine);
* }</pre>
*
* <p>If Flutter is needed in a location that can only use a {@code View}, consider using a {@link
* FlutterView}. Using a {@link FlutterView} requires forwarding some calls from an {@code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,16 @@
* <p>To connect part of an Android app to Flutter's C/C++ engine, instantiate a {@code FlutterJNI}
* and then attach it to the native side:
*
* <p>{@code // Instantiate FlutterJNI and attach to the native side. FlutterJNI flutterJNI = new
* FlutterJNI(); flutterJNI.attachToNative();
* <pre>{@code
* // Instantiate FlutterJNI and attach to the native side.
* FlutterJNI flutterJNI = new FlutterJNI();
* flutterJNI.attachToNative();
*
* <p>// Use FlutterJNI as desired. flutterJNI.dispatchPointerDataPacket(...);
* // Use FlutterJNI as desired. flutterJNI.dispatchPointerDataPacket(...);
*
* <p>// Destroy the connection to the native side and cleanup.
* flutterJNI.detachFromNativeAndReleaseResources(); }
* // Destroy the connection to the native side and cleanup.
* flutterJNI.detachFromNativeAndReleaseResources();
* }</pre>
*
* <p>To provide a visual, interactive surface for Flutter rendering and touch events, register a
* {@link RenderSurface} with {@link #setRenderSurface(RenderSurface)}
Expand Down