dart:ffi 只能绑定C语言的符号, 所以C++需要加上 extern “C” attribute((visibility(“default”))) attribute((used))
C/C++源码建议写在ios/Classes/native_add.cpp目录, 因为CocoaPods
不允许源码在
.podspec
上层目录, 而gradle
允许
Binding to native code using dart:ffi Dart/Flutter ffi (Foreig Function Interface) native callbacks eg: sqlite3_exec