A Deep Dive into Dart FFI
summary
A Flutter app called IMA integrates legacy C++ (OpenCV, custom inference engine) via Dart FFI using generated bindings (FFI gen), shared libraries and explicit use of dart_post_cobject, receive/send ports and newer native callables (Dart 3.1+) to avoid UI blocking. The pipeline streams ultrasound images into background isolates, runs C++ inference threads, and posts typed data back to Dart; pilots in Kenya and India report successful deployments and the project secured a $15 million grant.
AI-written summary · about
chapters (14)
- 0:00Fluttercon USA intro
- 1:04Dart FFI in healthcare
- 6:23Dart interoperability now
- 10:40Bridging Dart and C++
- 14:16Native-Dart architecture
- 17:23Three FFI communication ways
- 22:00Shared libraries for FFI
- 24:25Manual FFI bindings
- 27:34Async Dart-C++ ports
- 33:32Async callbacks in FFI
- 35:40Native callables for FFI
- 39:16FFI implementation tips
- 41:24FFI future with other languages
- 42:49Resources and closing
related talks
35mMachines and Code Analysis - What makes Dart and Flutter run
23mAOT compiling Dart for iOS Android
28mUsing Rust in your next Flutter SDK
31mBuilding a rendering engine in Rust for Flutter
45mAn IPC Language For The Whole Operating System
46mHow I Stopped Being Afraid and Learned to Love the Dart Compiler
01h 02mPolyglot Programming through Foreign Function Interfaces
01h 00mLightweight Operator Fusion Using Data-Centric Function Interfaces in C++
