### Verify Java Development Kit Installation Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/03_environment/openharmony-flutter-environment-setup.md Command to verify that the required JDK 17 environment is correctly installed and accessible in the system path. ```bash java -version ``` -------------------------------- ### getComposingStart Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/plugin/editing/ListenableEditingState/classes/ListenableEditingState.md Gets the current composing region start position. ```APIDOC ## GET /getComposingStart ### Description Gets the current composing region start position. ### Method GET ### Endpoint /getComposingStart ### Response #### Success Response (200) * **composingStart** (`number`) - The composing start position, or -1 if no composing region. #### Response Example ```json { "composingStart": 0 } ``` ``` -------------------------------- ### Deploy Flutter Applications to OpenHarmony Devices Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/03_environment/openharmony-flutter-environment-setup.md Methods for installing and running compiled HAP files on physical OpenHarmony devices. Includes direct execution via Flutter CLI and manual installation using the hdc tool. ```sh # Method 1: Compile and install via Flutter CLI flutter run --debug -d # Method 2: Manual build and install via hdc flutter build hap --debug hdc -t install ``` -------------------------------- ### getSelectionStart Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/plugin/editing/ListenableEditingState/classes/ListenableEditingState.md Gets the current selection start position. ```APIDOC ## GET /getSelectionStart ### Description Gets the current selection start position. ### Method GET ### Endpoint /getSelectionStart ### Response #### Success Response (200) * **selectionStart** (`number`) - The selection start position. #### Response Example ```json { "selectionStart": 10 } ``` ``` -------------------------------- ### Configure Flutter example pubspec.yaml Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/07_plugin/developing-an-ohos-plugin-using-flutter.md Configures the example application's pubspec.yaml to include the local path_provider plugin and define the OHOS platform support. ```yaml name: path_provider_example description: Demonstrates how to use the path_provider plugin. publish_to: none environment: sdk: ">=2.18.0 <4.0.0" flutter: ">=3.3.0" dependencies: flutter: sdk: flutter path_provider: path: ../../path_provider path_provider_platform_interface: ^2.0.0 dev_dependencies: flutter_test: sdk: flutter integration_test: sdk: flutter flutter: uses-material-design: true ``` -------------------------------- ### Configuring Permissions and Resource Strings Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/07_plugin/template_EN.md Examples for defining required permissions in the module configuration and providing localized reasons in string.json. ```json "requestPermissions": [ { "name": "ohos.permission.INTERNET", "reason": "$string:network_reason", "usedScene": { "abilities": [ "EntryAbility" ], "when":"inuse" } } ] ``` ```json { "string": [ { "name": "network_reason", "value": "使用网络" } ] } ``` -------------------------------- ### Run Flutter Example on OpenHarmony Device (Shell) Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/09_specifications/update-flutter-plugin-structure.md Command to run the Flutter example application on a connected OpenHarmony device. Ensure the device is properly configured and the signature is set up in DevEco Studio. ```shell cd integration_test/example flutter run -d $DEVICE --debug ``` -------------------------------- ### getPreviewTextStart Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/plugin/editing/ListenableEditingState/classes/ListenableEditingState.md Gets the start position of the preview text in the original text. ```APIDOC ## GET /getPreviewTextStart ### Description Gets the start position of the preview text in the original text. ### Method GET ### Endpoint /getPreviewTextStart ### Response #### Success Response (200) * **previewTextStart** (`number`) - The preview text start position. #### Response Example ```json { "previewTextStart": 5 } ``` ``` -------------------------------- ### Preload Flutter Engine on Button Touch (ArkTS) Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/04_development/using-flutterEnginePreload.md This example demonstrates how to preload a Flutter engine when a button is touched. It uses the `FlutterEnginePreload.preloadEngine` method with context and parameters. The `onClick` event handles navigation to the Flutter page. ```arkts build() { Button(this.title) .onClick(() => { try { router.pushUrl({ url: 'pages/Flutter', params: { route: this.route } }); } catch (err) { Log.d(TAG, `跳转页面${this.route} error === ${JSON.stringify(err)}`); } }) .onTouch((touch: TouchEvent) => { if (touch.type == TouchType.Down) { let params: Record = {}; params['route'] = this.route; FlutterEnginePreload.preloadEngine(getContext(this), params); } }); } ``` -------------------------------- ### Installing Flutter Plugin Dependencies Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/07_plugin/template_EN.md Methods for adding dependencies to a project using either npm or the pubspec.yaml configuration file. ```bash npm install @flutter-tpl/<库名>@file:# ``` ```yaml dependencies: image_picker: git: url: https://gitcode.com/openharmony-tpc/flutter_packages.git path: packages/image_picker ``` -------------------------------- ### Usage Example for OpenHarmony Build Aliases Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/08_FAQ/ohos-hap.md Demonstrates how to initialize a project for OpenHarmony and execute the previously configured build and run aliases. ```shell flutter create hello --platforms ohos cd hello # Compile the debug version. fbuildD # Run the debug version. frunD ``` -------------------------------- ### Documenting OpenHarmony Links in README Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/07_plugin/template_EN.md Format for adding OpenHarmony documentation links to the main project README file. ```markdown ### OpenHarmony - [中文](../camera_ohos/README_CN.md) - [EN](../camera_ohos/README.md) ``` -------------------------------- ### Configure HAP File Reference in Example (JSON) Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/09_specifications/update-flutter-plugin-structure.md Adjusts the 'oh-package.json5' file within the example directory to correctly reference the generated HAP files. This ensures the example app can locate and utilize the plugin's OpenHarmony module. ```json { // ... "dependencies": { "@ohos/flutter_ohos": "file:./har/flutter.har" }, "overrides": { "@ohos/flutter_ohos": "file:./har/flutter.har" } } ``` -------------------------------- ### Configure Pub Mirror for Flutter Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/03_environment/openharmony-flutter-environment-setup.md Environment variable configuration to speed up dependency resolution by using a mirror source for pub packages and Flutter storage. ```bash PUB_HOSTED_URL=https://mirrors.tuna.tsinghua.edu.cn/dart-pub FLUTTER_STORAGE_BASE_URL=https://mirrors.tuna.tsinghua.edu.cn/flutter ``` -------------------------------- ### Pre-draw Cached Flutter Engines with Viewport and ID Offset (ArkTS) Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/04_development/using-flutterEnginePreload.md This complex example shows how to pre-draw multiple cached Flutter engines. It involves setting custom viewport metrics for non-fullscreen rendering and managing unique `FlutterViewId`s using offsets. The `FlutterEnginePreload.predrawEngine` method is used with pre-obtained engine instances from `FlutterEngineCache`. ```arkts .onTouch((touch: TouchEvent) => { if (touch.type == TouchType.Down) { let params: Record = {}; let viewports: ViewportMetrics = new ViewportMetrics(); // 多引擎时,对传入的 view ID 手动添加偏移 let nextViewId = FlutterManager.getInstance().getNextFlutterViewId(); let nextViewId2 = FlutterManager.getInstance().getNextFlutterViewId(1); viewports.physicalWidth = display.getDefaultDisplaySync().width; viewports.physicalHeight = display.getDefaultDisplaySync().height / 2; params[FlutterAbilityLaunchConfigs.PRELOAD_VIEWPORT_METRICS_KEY] = viewports; FlutterEnginePreload.predrawEngine( FlutterEngineCache.getInstance().get('DoubleFlutterTop'), params, nextViewId ); FlutterEnginePreload.predrawEngine( FlutterEngineCache.getInstance().get('DoubleFlutterBottom'), params, nextViewId2 ); } }); ``` -------------------------------- ### Set Preview Text Start Position Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/plugin/editing/ListenableEditingState/classes/ListenableEditingState.md Sets the start position for the preview text. This function accepts a number indicating the start position and returns void. ```dart void setPreviewTextStart(int previewTextStart) ``` -------------------------------- ### Install HAP Manually on OpenHarmony Source: https://context7.com/smdegz/harmenyflutterdoc/llms.txt This command installs a HAP (Harmony Application Package) file onto a specified OpenHarmony device using the hdc (HUAWEI Device Connector) tool. Ensure the device ID is correctly provided and the path to the HAP file is accurate. ```bash hdc -t install path/to/app.hap ``` -------------------------------- ### Create and Build Flutter Projects for OpenHarmony Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/03_environment/openharmony-flutter-environment-setup.md Commands to initialize a Flutter project with OpenHarmony support and compile the HAP package. Supports creating projects with specific platform targets or all standard platforms. ```sh # Method 1 for project creation: Only the ohos platform is created. flutter create --platforms ohos # Method 2 for project creation: Android, iOS, and ohos platforms are created. flutter create # Go to the root directory of the project and compile the HAP. flutter build hap --debug ``` -------------------------------- ### Clone OpenHarmony Flutter Repository Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/03_environment/openharmony-flutter-environment-setup.md Commands to clone the OpenHarmony-specific Flutter repository and switch to the development branch to access the latest features. ```bash git clone https://gitcode.com/openharmony-tpc/flutter_flutter.git git checkout -b dev origin/dev ``` -------------------------------- ### Create Flutter Project for OpenHarmony Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/03_environment/OpenHarmony-device-operation-guide.md Creates a new Flutter project with OpenHarmony as a target platform. This command initializes the project structure required for developing cross-platform applications. ```bash flutter create --platforms ohos ``` -------------------------------- ### Configure System Environment Variables Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/03_environment/openharmony-flutter-environment-setup.md Commands to identify the current shell and update the configuration file (e.g., .bash_profile or .zshrc) with required Flutter and OpenHarmony SDK paths. ```bash echo $SHELL vi ~/.bash_profile # Add the following configurations: export PUB_HOSTED_URL=https://pub.flutter-io.cn export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn export PATH=/Users/admin/ohos/flutter_flutter/bin:$PATH export TOOL_HOME=/Applications/DevEco-Studio.app/Contents export DEVECO_SDK_HOME=$TOOL_HOME/sdk export PATH=$TOOL_HOME/tools/ohpm/bin:$PATH export PATH=$TOOL_HOME/tools/hvigor/bin:$PATH export PATH=$TOOL_HOME/tools/node/bin:$PATH source ~/.bash_profile ``` -------------------------------- ### Running Flutter on OpenHarmony Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/07_plugin/template_EN.md Command to execute and compile the Flutter application on a specific OpenHarmony device. ```bash flutter run -d xxxxxxxx ``` -------------------------------- ### Modify Sandbox Configuration for /system/lib64 Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/03_environment/OpenHarmony-device-operation-guide.md Updates the application sandbox configuration file to include the '/system/lib64' path. This allows applications to access libraries located in this directory. ```json { "src-path": "/system/lib64", "sandbox-path": "/system/lib64", "sandbox-flags": [ "bind", "rec" ], "check-action-status": "false" } ``` -------------------------------- ### SystemChromeStyle Constructor Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/embedding/engine/systemchannels/PlatformChannel/classes/SystemChromeStyle.md Constructs a new SystemChromeStyle instance with specified colors and brightness for system UI elements. ```APIDOC ## Constructor SystemChromeStyle ### Description Constructs a new SystemChromeStyle instance. ### Method CONSTRUCTOR ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **statusBarColor** (number) - Required - The status bar color - **statusBarIconBrightness** (Brightness) - Required - The status bar icon brightness - **systemStatusBarContrastEnforced** (boolean) - Required - Whether status bar contrast is enforced - **systemNavigationBarColor** (number) - Required - The navigation bar color - **systemNavigationBarIconBrightness** (Brightness) - Required - The navigation bar icon brightness - **systemNavigationBarDividerColor** (number) - Required - The navigation bar divider color - **systemNavigationBarContrastEnforced** (boolean) - Required - Whether navigation bar contrast is enforced ### Request Example ```json { "statusBarColor": 16777215, "statusBarIconBrightness": "dark", "systemStatusBarContrastEnforced": false, "systemNavigationBarColor": 0, "systemNavigationBarIconBrightness": "light", "systemNavigationBarDividerColor": 16777215, "systemNavigationBarContrastEnforced": true } ``` ### Response #### Success Response (200) - **SystemChromeStyle** (object) - The newly created SystemChromeStyle object #### Response Example ```json { "statusBarColor": 16777215, "statusBarIconBrightness": "dark", "systemStatusBarContrastEnforced": false, "systemNavigationBarColor": 0, "systemNavigationBarIconBrightness": "light", "systemNavigationBarDividerColor": 16777215, "systemNavigationBarContrastEnforced": true } ``` ``` -------------------------------- ### Set Selection Start Position Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/plugin/editing/ListenableEditingState/classes/ListenableEditingState.md Sets the start position of the current selection. This function takes a number for the new start position and returns void. ```dart void setSelectionStart(int newSelectionStart) ``` -------------------------------- ### Initialize and Use ByteBuffer Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/util/ByteBuffer/classes/ByteBuffer.md Demonstrates how to instantiate a new ByteBuffer and access its properties such as current offset and remaining bytes. ```typescript const buffer = new ByteBuffer(); const offset = buffer.byteOffset; const remaining = buffer.bytesRemaining; console.log(`Offset: ${offset}, Remaining: ${remaining}`); ``` -------------------------------- ### Initialize and Compare ViewportMetrics Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/view/FlutterView/classes/ViewportMetrics.md Demonstrates how to instantiate a ViewportMetrics object, clone it, and compare two instances for equality. ```typescript const metrics = new ViewportMetrics(); metrics.physicalWidth = 1080; // Create a deep copy const clonedMetrics = metrics.clone(); // Check for equality const areEqual = metrics.isEqual(clonedMetrics); // Returns true ``` -------------------------------- ### Creating and Managing FlutterEngine in OpenHarmony Source: https://context7.com/smdegz/harmenyflutterdoc/llms.txt This TypeScript code illustrates how to create, initialize, and manage a FlutterEngine instance in OpenHarmony. It covers setting up the Dart execution environment, registering plugins, and interacting with platform channels for navigation and lifecycle events. Dependencies include modules from '@ohos/flutter_ohos'. ```typescript // Creating and managing FlutterEngine directly import FlutterEngine from '@ohosos/flutter_ohos/src/main/ets/embedding/engine/FlutterEngine' import { FlutterLoader } from '@ohosos/flutter_ohos/src/main/ets/embedding/engine/loader/FlutterLoader' import { DartEntrypoint } from '@ohosos/flutter_ohos/src/main/ets/embedding/engine/dart/DartExecutor' import { PlatformViewsController } from '@ohosos/flutter_ohos/src/main/ets/plugin/platform/PlatformViewsController' import common from '@ohos.app.ability.common' async function createFlutterEngine(context: common.Context): Promise { // Create engine with default components const engine = new FlutterEngine( context, null, // FlutterLoader - auto-created if null null, // FlutterNapi - auto-created if null null // PlatformViewsController - auto-created if null ) // Initialize the engine engine.init(context, [], false) // Execute Dart code const dartExecutor = engine.getDartExecutor() const entrypoint = DartEntrypoint.createDefault() dartExecutor.executeDartEntrypoint(entrypoint) // Access various channels const lifecycleChannel = engine.getLifecycleChannel() lifecycleChannel?.appIsResumed() const navigationChannel = engine.getNavigationChannel() navigationChannel?.setInitialRoute('/home') return engine } // Cleanup when done function destroyEngine(engine: FlutterEngine): void { engine.destroy() } ``` -------------------------------- ### Get Pending Channel Response Count Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/embedding/engine/dart/DartExecutor/classes/DartExecutor.md Gets the number of pending channel callback replies. This is useful for testing frameworks to determine if the application is idle. ```typescript dartExecutor.getPendingChannelResponseCount() ``` -------------------------------- ### getStringCache Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/plugin/editing/ListenableEditingState/classes/ListenableEditingState.md Gets the current text content. ```APIDOC ## GET /getStringCache ### Description Gets the current text content. ### Method GET ### Endpoint /getStringCache ### Response #### Success Response (200) * **text** (`string`) - The current text content. #### Response Example ```json { "text": "This is the current text." } ``` ``` -------------------------------- ### Initialize and Configure FlutterEngine Options Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/embedding/engine/FlutterEngineGroup/classes/Options.md Demonstrates how to instantiate the Options class and configure various settings such as the initial route and Dart entrypoint arguments. These methods support method chaining for fluent configuration. ```dart final options = Options(context) .setInitialRoute("/") .setDartEntrypointArgs(["--verbose"]) .setWaitForRestorationData(true); ``` -------------------------------- ### getSelectionString Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/plugin/editing/ListenableEditingState/classes/ListenableEditingState.md Gets the currently selected text. ```APIDOC ## GET /getSelectionString ### Description Gets the currently selected text. ### Method GET ### Endpoint /getSelectionString ### Response #### Success Response (200) * **selectedText** (`string`) - The selected text, or empty string if selection is invalid. #### Response Example ```json { "selectedText": "example text" } ``` ``` -------------------------------- ### getRightTextOfCursor Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/plugin/editing/ListenableEditingState/classes/ListenableEditingState.md Gets the text to the right of the cursor. ```APIDOC ## GET /getRightTextOfCursor ### Description Gets the text to the right of the cursor. ### Method GET ### Endpoint /getRightTextOfCursor ### Parameters #### Query Parameters * **length** (`number`) - Required - The maximum number of characters to return. ### Response #### Success Response (200) * **text** (`string`) - The text to the right of the cursor. #### Response Example ```json { "text": "Flutter" } ``` ``` -------------------------------- ### Instantiate FlutterEngine Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/embedding/engine/FlutterEngine/classes/FlutterEngine.md Demonstrates how to construct a new FlutterEngine instance. This constructor initializes various components like DartExecutor, channels, plugins, and listeners. It requires context and optionally accepts FlutterLoader, FlutterNapi, and PlatformViewsController. ```typescript new FlutterEngine(context, flutterLoader, flutterNapi, platformViewsController) ``` -------------------------------- ### getLeftTextOfCursor Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/plugin/editing/ListenableEditingState/classes/ListenableEditingState.md Gets the text to the left of the cursor. ```APIDOC ## GET /getLeftTextOfCursor ### Description Gets the text to the left of the cursor. ### Method GET ### Endpoint /getLeftTextOfCursor ### Parameters #### Query Parameters * **length** (`number`) - Required - The maximum number of characters to return. ### Response #### Success Response (200) * **text** (`string`) - The text to the left of the cursor. #### Response Example ```json { "text": "Hello" } ``` ``` -------------------------------- ### FlutterApplicationInfo Constructor Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/embedding/engine/loader/FlutterApplicationInfo/classes/FlutterApplicationInfo.md Constructs a new FlutterApplicationInfo instance with specified configuration parameters. ```APIDOC ## Constructor FlutterApplicationInfo ### Description Constructs a new FlutterApplicationInfo instance. ### Method CONSTRUCTOR ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **aotSharedLibraryName** (string) - Optional - Name of the AOT shared library, or null to use default * **vmSnapshotData** (string) - Optional - Name of the VM snapshot data file, or null to use default * **isolateSnapshotData** (string) - Optional - Name of the isolate snapshot data file, or null to use default * **flutterAssetsDir** (string) - Optional - Directory containing Flutter assets, or null to use default * **domainNetworkPolicy** (string) - Optional - Domain network policy, or null for empty string * **nativeLibraryDir** (string) - Required - Directory containing native libraries * **automaticallyRegisterPlugins** (boolean) - Required - Whether to automatically register plugins ### Request Example ```json { "aotSharedLibraryName": "libflutter.so", "vmSnapshotData": "vm_snapshot_data", "isolateSnapshotData": "isolate_snapshot_data", "flutterAssetsDir": "/path/to/assets", "domainNetworkPolicy": "example.com", "nativeLibraryDir": "/path/to/native/libs", "automaticallyRegisterPlugins": true } ``` ### Response #### Success Response (200) * **FlutterApplicationInfo** (object) - The newly created FlutterApplicationInfo instance. #### Response Example ```json { "aotSharedLibraryName": "libflutter.so", "vmSnapshotData": "vm_snapshot_data", "isolateSnapshotData": "isolate_snapshot_data", "flutterAssetsDir": "/path/to/assets", "domainNetworkPolicy": "example.com", "nativeLibraryDir": "/path/to/native/libs", "automaticallyRegisterPlugins": true, "isDebugMode": false, "isProfile": false } ``` ``` -------------------------------- ### PlatformViewRegistryImpl Constructor Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/plugin/platform/PlatformViewRegistryImpl/classes/PlatformViewRegistryImpl.md Constructs a new PlatformViewRegistryImpl instance. ```APIDOC ## Constructor PlatformViewRegistryImpl ### Description Constructs a new PlatformViewRegistryImpl instance. ### Method `constructor` ### Endpoint N/A ### Parameters None ### Request Example ```javascript const registry = new PlatformViewRegistryImpl(); ``` ### Response #### Success Response (200) - **instance** (`PlatformViewRegistryImpl`) - A new instance of PlatformViewRegistryImpl. #### Response Example ```json { "instance": "PlatformViewRegistryImpl" } ``` ``` -------------------------------- ### getSelectionEnd Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/plugin/editing/ListenableEditingState/classes/ListenableEditingState.md Gets the current selection end position. ```APIDOC ## GET /getSelectionEnd ### Description Gets the current selection end position. ### Method GET ### Endpoint /getSelectionEnd ### Response #### Success Response (200) * **selectionEnd** (`number`) - The selection end position. #### Response Example ```json { "selectionEnd": 15 } ``` ``` -------------------------------- ### FlutterAbilityLaunchConfigs Reference Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/embedding/ohos/FlutterAbilityLaunchConfigs/classes/FlutterAbilityLaunchConfigs.md A collection of static constants used to configure Flutter ability launch parameters, including metadata keys and default values. ```APIDOC ## FlutterAbilityLaunchConfigs Constants ### Description This class provides a centralized set of constants for configuring Flutter ability launch parameters, including entrypoint definitions, engine management, and UI behavior. ### Key Constants - **DART_ENTRYPOINT_META_DATA_KEY** (string) - Metadata key for the Dart entrypoint. - **DART_ENTRYPOINT_URI_META_DATA_KEY** (string) - Metadata key for the Dart entrypoint URI. - **DEFAULT_BACKGROUND_MODE** (BackgroundMode) - Default background mode (opaque). - **DEFAULT_DART_ENTRYPOINT** (string) - Default entrypoint name ("main"). - **DEFAULT_INITIAL_ROUTE** (string) - Default initial route ("/"). - **EXTRA_CACHED_ENGINE_ID** (string) - Intent extra for cached engine ID. - **EXTRA_INITIAL_ROUTE** (string) - Intent extra for the initial route. - **HANDLE_DEEPLINKING_META_DATA_KEY** (string) - Metadata key for enabling deeplinking. ### Usage Example ```dart // Example of using a constant to define an intent extra intent.putExtra(FlutterAbilityLaunchConfigs.EXTRA_INITIAL_ROUTE, "/home"); ``` ### Full Property List - **DART_ENTRYPOINT_META_DATA_KEY**: "io.flutter.Entrypoint" - **DART_ENTRYPOINT_URI_META_DATA_KEY**: "io.flutter.EntrypointUri" - **EXTRA_DART_ENTRYPOINT**: "dart_entrypoint" - **EXTRA_DART_ENTRYPOINT_ARGS**: "dart_entrypoint_args" - **EXTRA_ENABLE_STATE_RESTORATION**: "enable_state_restoration" - **SPLASH_SCREEN_META_DATA_KEY**: "io.flutter.embedding.android.SplashScreenDrawable" ``` -------------------------------- ### Update Entry OH-Package.json5 for Example (JSON) Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/09_specifications/update-flutter-plugin-structure.md Modifies the entry 'oh-package.json5' file in the example's 'ohos/entry' directory. It updates the dependency path for the plugin's HAP file to correctly point to the 'har' directory. ```json { // ... "dependencies": { "integration_test": "file:../har/integration_test.har" } } ``` -------------------------------- ### getPreviewText Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/plugin/editing/ListenableEditingState/classes/ListenableEditingState.md Gets the current preview text from the input method. ```APIDOC ## GET /getPreviewText ### Description Gets the current preview text from the input method. ### Method GET ### Endpoint /getPreviewText ### Response #### Success Response (200) * **previewText** (`string`) - The preview text. #### Response Example ```json { "previewText": "World" } ``` ``` -------------------------------- ### Clean Repository for Reproducible Demos Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/08_FAQ/README_EN.md A set of git commands to initialize a repository and remove all untracked files, useful for creating minimal reproducible demo packages. ```shell git init git add -A git commit -m "init" git clean -dfx ``` -------------------------------- ### getComposingEnd Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/plugin/editing/ListenableEditingState/classes/ListenableEditingState.md Gets the current composing region end position. ```APIDOC ## GET /getComposingEnd ### Description Gets the current composing region end position. ### Method GET ### Endpoint /getComposingEnd ### Response #### Success Response (200) * **composingEnd** (`number`) - The composing end position, or -1 if no composing region. #### Response Example ```json { "composingEnd": 5 } ``` ``` -------------------------------- ### getRestorationData() Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/embedding/engine/systemchannels/RestorationChannel/classes/RestorationChannel.md Gets the most current restoration data that the framework has provided. ```APIDOC ## getRestorationData() ### Description Gets the most current restoration data that the framework has provided. ### Method `Uint8Array` ### Endpoint N/A (Method within a class) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "method": "getRestorationData" } ``` ### Response #### Success Response (200) - **data** (`Uint8Array`) - The restoration data as a Uint8Array #### Response Example ```json { "data": "" } ``` ``` -------------------------------- ### getPreviewTextEnd Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/plugin/editing/ListenableEditingState/classes/ListenableEditingState.md Gets the end position of the preview text in the original text. ```APIDOC ## GET /getPreviewTextEnd ### Description Gets the end position of the preview text in the original text. ### Method GET ### Endpoint /getPreviewTextEnd ### Response #### Success Response (200) * **previewTextEnd** (`number`) - The preview text end position. #### Response Example ```json { "previewTextEnd": 10 } ``` ``` -------------------------------- ### Initialize and Manage FlutterNapi Instance Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/embedding/engine/FlutterNapi/classes/FlutterNapi.md Demonstrates the instantiation of the FlutterNapi class and the essential lifecycle methods for attaching to the native engine and releasing resources. ```TypeScript const flutterNapi = new FlutterNapi(); // Attach to the native engine before performing operations flutterNapi.attachToNative(); // Perform operations... // Clean up resources when finished flutterNapi.detachFromNativeAndReleaseResources(); ``` -------------------------------- ### getIsCursorIdxOutOfPreviewTextRange Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/plugin/editing/ListenableEditingState/classes/ListenableEditingState.md Gets whether the cursor index is out of the preview text range. ```APIDOC ## GET /getIsCursorIdxOutOfPreviewTextRange ### Description Gets whether the cursor index is out of the preview text range. ### Method GET ### Endpoint /getIsCursorIdxOutOfPreviewTextRange ### Response #### Success Response (200) * **isOutOfRange** (`boolean`) - True if the cursor is out of range, false otherwise. #### Response Example ```json { "isOutOfRange": false } ``` ``` -------------------------------- ### createAndRunEngineByOptions() Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/embedding/engine/FlutterEngineGroup/classes/FlutterEngineGroup.md Creates and runs a Flutter engine based on the provided options. If no engines exist, it creates a new one; otherwise, it spawns from the first existing engine. ```APIDOC ## POST /createAndRunEngineByOptions ### Description Creates and runs a Flutter engine based on the provided options. If no engines exist, creates a new engine. Otherwise, spawns from the first engine. ### Method POST ### Endpoint /createAndRunEngineByOptions ### Parameters #### Request Body - **options** (Options) - Required - Configuration options for engine creation. ### Request Example ```json { "example": { "options": { "route": "/", "initialRouteList": ["/", "/home"] } } } ``` ### Response #### Success Response (200) - **any** - The created or spawned FlutterEngine instance. #### Response Example ```json { "example": "FlutterEngine instance" } ``` ``` -------------------------------- ### PlatformViewsController Properties Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/plugin/platform/PlatformViewsController/classes/PlatformViewsController.md Methods for getting and setting parameters within the DVModelParameters. ```APIDOC ## GET /smdegz/harmenyflutterdoc/PlatformViewsController/getParams ### Description Gets a parameter value from the DVModelParameters. ### Method GET ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **params** (DVModelParameters) - Required - The parameters object to read from - **key** (string) - Required - The parameter key ### Request Example ```dart final params = DVModelParameters(); // Assume params is initialized final value = controller.getParams(params, 'someKey'); ``` ### Response #### Success Response (200) - **value** (number) - The parameter value as a number #### Response Example ```json { "value": 123 } ``` ## PlatformViewsController/setParams ### Description Sets a parameter value in the DVModelParameters. ### Method POST ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **params** (DVModelParameters) - Required - The parameters object to modify - **key** (string) - Required - The parameter key - **element** (Any) - Required - The value to set ### Request Example ```dart final params = DVModelParameters(); // Assume params is initialized controller.setParams(params, 'someKey', 'someValue'); ``` ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Get Application Data Directory (OpenHarmony) Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/util/PathUtils/classes/PathUtils.md Gets or creates the Flutter data directory for the application using the provided context. Returns the directory path or null if creation fails. This method is part of the PathUtils utility class in OpenHarmony. ```typescript import { PathUtils } from '@ohos/etsapi'; // Assuming 'context' is available const dataDir: string | null = PathUtils.getDataDirectory(context); ``` -------------------------------- ### UIAbility and WindowStage Management Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/embedding/ohos/FlutterManager/classes/FlutterManager.md Methods to manage the lifecycle and associations of UIAbility and WindowStage instances. ```APIDOC ## [METHOD] pushUIAbility ### Description Pushes a UIAbility to the internal management list. ### Method void ### Parameters #### Request Body - **uiAbility** (UIAbility) - Required - The UIAbility to add *** ## [METHOD] popUIAbility ### Description Removes a UIAbility from the internal management list. ### Method void ### Parameters #### Request Body - **uiAbility** (UIAbility) - Required - The UIAbility to remove *** ## [METHOD] pushWindowStage ### Description Associates a specific WindowStage with a given UIAbility. ### Method void ### Parameters #### Request Body - **uiAbility** (UIAbility) - Required - The UIAbility - **windowStage** (WindowStage) - Required - The WindowStage to associate *** ## [METHOD] popWindowStage ### Description Removes the WindowStage association for a specific UIAbility. ### Method void ### Parameters #### Request Body - **uiAbility** (UIAbility) - Required - The UIAbility ``` -------------------------------- ### Pre-warm Flutter Engines with FlutterEngineCache (TypeScript) Source: https://context7.com/smdegz/harmenyflutterdoc/llms.txt Illustrates how to use FlutterEngineCache to pre-warm and store FlutterEngine instances, significantly reducing the startup latency for Flutter content. It includes methods for pre-warming, retrieving cached engines, and cleaning them up. ```typescript // Pre-warming and caching Flutter engines import { FlutterEngineCache } from '@ohos/flutter_ohos/src/main/ets/embedding/engine/FlutterEngineCache' import FlutterEngine from '@ohos/flutter_ohos/src/main/ets/embedding/engine/FlutterEngine' import { DartEntrypoint } from '@ohos/flutter_ohos/src/main/ets/embedding/engine/dart/DartExecutor' import common from '@ohos.app.ability.common' const ENGINE_ID = "my_cached_engine" // Pre-warm an engine during app initialization async function preWarmEngine(context: common.Context): Promise { const cache = FlutterEngineCache.getInstance() // Check if already cached if (cache.contains(ENGINE_ID)) { return } // Create and warm up the engine const engine = new FlutterEngine(context, null, null, null) engine.init(context, [], false) // Start Dart execution const dartExecutor = engine.getDartExecutor() dartExecutor.executeDartEntrypoint(DartEntrypoint.createDefault()) // Cache the engine cache.put(ENGINE_ID, engine) } // Retrieve cached engine in FlutterAbility export default class CachedEngineAbility extends FlutterAbility { // Return the cached engine ID getCachedEngineId(): string { return ENGINE_ID } // Don't destroy cached engine when ability is destroyed shouldDestroyEngineWithHost(): boolean { return false } } // Clean up when app terminates function cleanupCachedEngines(): void { const cache = FlutterEngineCache.getInstance() const engine = cache.get(ENGINE_ID) if (engine) { engine.destroy() cache.remove(ENGINE_ID) } } ``` -------------------------------- ### getRightIdxOfPreviewTextRange Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/plugin/editing/ListenableEditingState/classes/ListenableEditingState.md Gets the right index of the preview text range in the string cache. ```APIDOC ## GET /getRightIdxOfPreviewTextRange ### Description Gets the right index of the preview text range in the string cache. ### Method GET ### Endpoint /getRightIdxOfPreviewTextRange ### Response #### Success Response (200) * **rightIndex** (`number`) - The right index of the preview text range. #### Response Example ```json { "rightIndex": 10 } ``` ``` -------------------------------- ### Initialize StandardMethodCodec Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/plugin/common/StandardMethodCodec/classes/StandardMethodCodec.md Demonstrates how to instantiate the StandardMethodCodec using a provided StandardMessageCodec. ```typescript const messageCodec = new StandardMessageCodec(); const methodCodec = new StandardMethodCodec(messageCodec); ``` -------------------------------- ### getLeftIdxOfPreviewTextRange Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/plugin/editing/ListenableEditingState/classes/ListenableEditingState.md Gets the left index of the preview text range in the string cache. ```APIDOC ## GET /getLeftIdxOfPreviewTextRange ### Description Gets the left index of the preview text range in the string cache. ### Method GET ### Endpoint /getLeftIdxOfPreviewTextRange ### Response #### Success Response (200) * **leftIndex** (`number`) - The left index of the preview text range. #### Response Example ```json { "leftIndex": 0 } ``` ``` -------------------------------- ### getId() - Get Overlay Surface ID Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/embedding/engine/FlutterOverlaySurface/classes/FlutterOverlaySurface.md Retrieves the unique identifier of the FlutterOverlaySurface. ```APIDOC ## getId() ### Description Gets the unique identifier of this overlay surface. ### Method `getId(): number` ### Endpoint N/A (Method call on an instance) ### Parameters None ### Request Example ```javascript const overlaySurface = new FlutterOverlaySurface(456); const id = overlaySurface.getId(); console.log(id); // Output: 456 ``` ### Response #### Success Response (200) - **id** (number) - The overlay surface ID #### Response Example ```json { "id": 456 } ``` ``` -------------------------------- ### FlutterShellArgs Initialization Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/embedding/engine/FlutterShellArgs/classes/FlutterShellArgs.md Constructor and property management for Flutter shell command-line arguments. ```APIDOC ## CONSTRUCTOR FlutterShellArgs ### Description Initializes a new instance of the FlutterShellArgs class to manage engine arguments. ### Method NEW ### Parameters - **None** ### Request Example ```javascript const shellArgs = new FlutterShellArgs(); ``` ### Response - **returns** (FlutterShellArgs) - An instance of the argument manager. ``` -------------------------------- ### setComposingStart Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/plugin/editing/ListenableEditingState/classes/ListenableEditingState.md Sets the start position of the composing text region. A value of -1 clears the composing region. ```APIDOC ## setComposingStart ### Description Sets the composing region start position. ### Method Not specified (likely internal) ### Endpoint Not applicable (function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ##### newComposingStart (number) - Required - The new composing start position, or -1 to clear ### Request Example ```json { "newComposingStart": 10 } ``` ### Response #### Success Response (200) - **void** - This function does not return a value. #### Response Example ```json null ``` ``` -------------------------------- ### Get System Languages Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/embedding/engine/FlutterNapi/classes/FlutterNapi.md Retrieves the list of system languages currently configured on the platform. ```typescript getSystemLanguages(): void; ``` -------------------------------- ### FlutterAbilityAndEntryDelegate Constructor Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/embedding/ohos/FlutterAbilityAndEntryDelegate/classes/FlutterAbilityAndEntryDelegate.md Constructs a new FlutterAbilityAndEntryDelegate instance. Optionally takes a Host instance. ```APIDOC ## Constructor FlutterAbilityAndEntryDelegate ### Description Constructs a new FlutterAbilityAndEntryDelegate instance. ### Method `new` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters #### host - **host** (`Host`) - Optional - The Host instance. ### Request Example ```json { "host": { /* Host object */ } } ``` ### Response #### Success Response (200) - **FlutterAbilityAndEntryDelegate** (`FlutterAbilityAndEntryDelegate`) - A new FlutterAbilityAndEntryDelegate instance. #### Response Example ```json { "instance": "FlutterAbilityAndEntryDelegate" } ``` ``` -------------------------------- ### replace Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/plugin/editing/ListenableEditingState/classes/ListenableEditingState.md Replaces a specified range of text with new content, with options for specifying start and end positions within the replacement text. ```APIDOC ## replace ### Description Replaces a range of text with new text. ### Method Not specified (likely internal) ### Endpoint Not applicable (function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ##### start (number) - Required - The start position of the range to replace ##### end (number) - Required - The end position of the range to replace ##### tb (String) - Required - The replacement text ##### tbStart (number) - Required - The start position within the replacement text ##### tbEnd (number) - Required - The end position within the replacement text ### Request Example ```json { "start": 5, "end": 10, "tb": "new content", "tbStart": 0, "tbEnd": 11 } ``` ### Response #### Success Response (200) - **void** - This function does not return a value. #### Response Example ```json null ``` ``` -------------------------------- ### Full Screen Configuration Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/embedding/ohos/FlutterManager/classes/FlutterManager.md Endpoints to toggle and check the full-screen status of the application. ```APIDOC ## [METHOD] setUseFullScreen ### Description Configures whether the application should operate in full-screen mode. ### Method void ### Parameters #### Request Body - **use** (boolean) - Required - Whether to use full screen - **context** (any) - Optional - Optional context *** ## [METHOD] useFullScreen ### Description Checks the current full-screen mode status. ### Method GET ### Response #### Success Response (200) - **result** (boolean) - True if full screen is enabled, false otherwise ``` -------------------------------- ### Manage Multiple Flutter Engines with FlutterEngineGroup (TypeScript) Source: https://context7.com/smdegz/harmenyflutterdoc/llms.txt Demonstrates how to use FlutterEngineGroup to create and manage multiple FlutterEngine instances that share resources, leading to reduced memory usage and faster startup times. It covers engine initialization, lifecycle management, and view attachment. ```typescript // Multi-engine setup with FlutterEngineGroup import { FlutterEngineGroup, Options } from '@ohos/flutter_ohos/src/main/ets/embedding/engine/FlutterEngineGroup' import { DartEntrypoint } from '@ohos/flutter_ohos/src/main/ets/embedding/engine/dart/DartExecutor' import { FlutterManager } from '@ohos/flutter_ohos/src/main/ets/embedding/ohos/FlutterManager' import { FlutterView } from '@ohos/flutter_ohos/src/main/ets/view/FlutterView' import { GeneratedPluginRegistrant } from '../plugins/GeneratedPluginRegistrant' import common from '@ohos.app.ability.common' // Create a shared engine group instance const engines = new FlutterEngineGroup() class EngineBindings { private engine?: FlutterEngine private context: common.Context private flutterView: FlutterView constructor(context: common.Context) { this.context = context this.flutterView = FlutterManager.getInstance().createFlutterView(context) } getFlutterViewId(): string { return this.flutterView.getId() } async attach(): Promise { if (this.engine) return // 1. Initialize loader await engines.checkLoader(this.context, []) // 2. Create engine with options const options = new Options(this.context) .setDartEntrypoint(DartEntrypoint.createDefault()) this.engine = await engines.createAndRunEngineByOptions(options) if (!this.engine) { throw new Error("Failed to create engine") } // 3. Resume lifecycle this.engine.getLifecycleChannel()?.appIsResumed() // 4. Attach to ability if available const ability = FlutterManager.getInstance().getTopUIAbility() if (ability) { this.engine.getAbilityControlSurface()?.attachToAbility(ability) } // 5. Attach view to engine this.flutterView.attachToFlutterEngine(this.engine) // 6. Register plugins GeneratedPluginRegistrant.registerWith(this.engine) } detach(): void { this.flutterView.detachFromFlutterEngine() this.engine?.destroy() this.engine = undefined } } ``` -------------------------------- ### Read Data from ByteBuffer Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/util/ByteBuffer/classes/ByteBuffer.md Examples of reading various data types from the buffer using specific offsets and endianness configurations. ```typescript const val = buffer.getInt32(0, true); // Read 32-bit int at offset 0, little-endian const str = buffer.getString(4, 10, 'utf8'); // Read string at offset 4 with length 10 const isSet = buffer.getBool(14); // Read boolean at offset 14 ``` -------------------------------- ### Start Deletion Operation Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/plugin/editing/ListenableEditingState/classes/ListenableEditingState.md Initiates a deletion operation, typically triggered by a key code. This function takes a number representing the key code and returns void. ```dart void startDeleting(int code) ``` -------------------------------- ### Initialize and Lifecycle Management for FlutterView Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/view/FlutterView/classes/FlutterView.md Demonstrates how to instantiate the FlutterView and manage its connection to a Flutter engine. These methods are essential for setting up the rendering surface and cleaning up resources upon destruction. ```TypeScript const view = new FlutterView("view_id", context); view.attachToFlutterEngine(engine); // Cleanup when no longer needed view.detachToFlutterEngine(); view.onDestroy(); ``` -------------------------------- ### BinaryCodec.INSTANCE_DIRECT Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/plugin/common/BinaryCodec/classes/BinaryCodec.md Provides a direct instance of BinaryCodec that returns the direct buffer from decoding. ```APIDOC ## BinaryCodec.INSTANCE_DIRECT ### Description Provides a direct instance of BinaryCodec that returns the direct buffer from decoding. This is a static, read-only property. ### Method GET ### Endpoint N/A (Static property) ### Returns `BinaryCodec` ### Response Example ```json { "instanceType": "BinaryCodec", "configuration": { "returnsDirectByteBufferFromDecoding": true } } ``` ``` -------------------------------- ### Manage Flutter Dependencies Offline Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/08_FAQ/environment.md Use the --offline flag to install dependencies when an active internet connection is unavailable. ```shell flutter pub get --offline ``` -------------------------------- ### System Navigation and Resource Cleanup Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/embedding/ohos/FlutterAbility/classes/FlutterAbility.md Utility methods for handling system navigation requests and releasing allocated resources. ```typescript function popSystemNavigator(): boolean; function release(): void; ``` -------------------------------- ### Get Texture ID (Dart) Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/embedding/engine/renderer/FlutterRenderer/classes/SurfaceTextureRegistryEntry.md Retrieves the texture ID. This ID is used to reference the texture within the registry. ```dart getTextureId(): number ``` -------------------------------- ### Initialize Flutter Engine Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/embedding/engine/FlutterNapi/classes/FlutterNapi.md Initializes the Flutter engine instance with required paths, context, and configuration arguments. ```typescript init(context: Context, args: string[], bundlePath: string, appStoragePath: string, engineCachesPath: string, initTimeMillis: number): void; ``` -------------------------------- ### View State and Property Access Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/view/FlutterView/classes/FlutterView.md Provides examples of retrieving the current state of the FlutterView, including active status, surface identification, and keyboard metrics. ```TypeScript const isActive = view.getActive(); const surfaceId = view.getSurfaceId(); const keyboardHeight = view.getKeyboardHeight(); const isRendered = view.hasRenderedFirstFrame(); ``` -------------------------------- ### Constructor: TextEditingDelta Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/plugin/editing/TextEditingDelta/classes/TextEditingDelta.md Initializes a new instance of TextEditingDelta to track changes in text editing state. ```APIDOC ## CONSTRUCTOR TextEditingDelta ### Description Constructs a new TextEditingDelta instance to track text, selection, and composing region changes. ### Parameters - **oldEditable** (string) - Required - The text before the change - **selectionStart** (number) - Required - The new selection start position - **selectionEnd** (number) - Required - The new selection end position - **composingStart** (number) - Required - The new composing region start position - **composingEnd** (number) - Required - The new composing region end position - **replacementDestinationStart** (number) - Optional - Start position of the replacement destination - **replacementDestinationEnd** (number) - Optional - End position of the replacement destination - **replacementSource** (string) - Optional - Replacement text ### Request Example { "oldEditable": "Hello", "selectionStart": 5, "selectionEnd": 5, "composingStart": 0, "composingEnd": 0 } ``` -------------------------------- ### Initialize FlutterPluginBinding Source: https://github.com/smdegz/harmenyflutterdoc/blob/main/11_flutter_api_docs/embedding/engine/plugins/FlutterPlugin/classes/FlutterPluginBinding.md Constructs a new instance of FlutterPluginBinding. This requires the application context, engine instance, binary messenger, assets, and texture registry, with an optional platform view registry. ```java FlutterPluginBinding binding = new FlutterPluginBinding( applicationContext, flutterEngine, binaryMessenger, flutterAssets, textureRegistry, platformViewRegistry ); ```