Binding to native Android code using dart:ffi

Platform integration

Android

Binding to native Android code using dart:ffi

Dynamic vs static linking

Step 1: Create a plugin

Step 2: Add C/C++ sources

Step 3: Load the code using the FFI library

Other use cases

Platform library

First-party library
Open-source third-party
Closed-source third-party library

Android APK size (shared object compression)

Flutter mobile and desktop apps can use the
dart:ffi library to call native C APIs.
FFI stands for foreign function interface.
Other terms for similar functionality include
native interface and language bindings.