Adopting native assets for cross-platform FFI plugins
summary
Announces that code assets (renamed from native assets) let Dart declare native functions at compile time so the toolchain links or bundles native libraries automatically, removing dynamic library.open and platform-channel glue. Uses FFI, build hooks, native_toolchain_c and ffigen to compile or fetch per-target .so/.dll/.dylib, enabling static linking, tree‑shaking of unused native code and per‑user compiler flags. Demonstrates SQLite package using dual-generated bindings (99.9% shared code) and notes the feature is experimental on main channel, not yet stable.
AI-written summary · about
chapters (13)
- 0:00Native assets for FFI plugins
- 1:04Speaker background and motivation
- 6:21Goals for Dart FFI bindings
- 8:49Limitations of platform channels
- 10:12Dart FFI basics and improvements
- 13:00Distributing native libraries
- 16:51Code assets for FFI
- 20:20Build hooks for distribution
- 25:12Code assets in builds
- 30:29Benefits and compatibility
- 33:16Migrating to code assets
- 35:44Future of data assets
- 37:08Q&A
related talks
31mSeamless Interoperability: Harnessing JNIGen and FFIGen
37mUsing Dart FFI for Compute-Heavy Tasks in Flutter Apps
14mC interoperability with Dart FFI
37mUsing Dart FFI for Compute-Heavy Tasks
38mThe past, present, and future of native interop
40mWho is a Native Bindings Author and why you should be one
43mSummit Session 2 - Past, Present and Future of Native Interop
50mPast, Present and Future of Native Interop
