Crates.io | irondash_engine_context |
lib.rs | irondash_engine_context |
version | 0.5.0 |
source | src |
created_at | 2022-11-10 18:16:58.232606 |
updated_at | 2023-12-26 15:00:26.927239 |
description | Easy access to FlutterView, FlutterBinaryMessenger and FlutterTextureRegistry for FFI. |
homepage | |
repository | https://github.com/irondash/irondash |
max_upload_size | |
id | 712285 |
size | 44,362 |
Flutter plugin that provides access to Flutter engine components (like view or texture registrar) from native code.
Dart code:
import 'package:irondash_engine_context/irondash_engine_context.dart';
final handle = await EngineContext.instance.getEngineHandle();
// pass the handle native code (i.e. through FFI).
nativeMethod(handle);
Rust code:
use irondash_engine_context::EngineContext;
let context = EngineContext::get().unwrap();
let flutter_view = context.get_flutter_view(handle);
let texture_registry = context.get_texture_registry(handle);
On Android, EngineContext can provide JavaVM instance and class loader that has loaded Flutter application:
let java_vm = EngineContext::get_java_vm()?;
let class_loader = EngineContext::get_class_loader()?;