dart:ffi Hello World

compile

# mac (.dylib)
g++ -dynamiclib -o shared_library/mac/libHelloWorld.dylib shared_library/src/hello_world.cpp

# Linux (.so)  if Android, have to compile for arm64 or arm
g++ -shared -o shared_library/linux/libHelloWorld.so shared_library/src/hello_world.cpp

hello world

pub get
pub run ./hello_world.dart

Reference