flutter_engine_context 0.1.0 copy "flutter_engine_context: ^0.1.0" to clipboard
flutter_engine_context: ^0.1.0 copied to clipboard

Easy access to FlutterView, FlutterBinaryMessenger and FlutterTextureRegistry for FFI.

flutter_engine_context #

Flutter plugin that provides access to Flutter engine components (like view or texture registrar) from native code.

Example #

Dart code:

    final handle = await FlutterEngineContext.instance.getEngineHandle();
    // pass the handle native code (i.e. through FFI).
    nativeMethod(handle);

Rust code:

    let context = FlutterEngineContext::new();
    let flutter_view = context.get_flutter_view(handle);
    let texture_registry = contet.get_texture_registry(handle);

Rust code for Android:

    let context = FlutterEngineContext::new(&jni_env, class_loader);
    let flutter_view = context.get_flutter_view(handle);
    let texture_registry = contet.get_texture_registry(handle);

On Android the FlutterEngineContext needs to be initialized with JNI environment and class loader used to load Flutter plugin (or application code).

0
likes
150
pub points
0%
popularity

Publisher

verified publishernativeshell.dev

Easy access to FlutterView, FlutterBinaryMessenger and FlutterTextureRegistry for FFI.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on flutter_engine_context