Please see
Binding to native code using dart:ffi
on
flutter.dev