Note:
  This page describes using the dart:ffi library
  in macOS desktop apps.
  For information on Android, see
  Binding to native Android code using dart:ffi.
  For information on iOS, see
  Binding to native iOS code using dart:ffi.
  This feature is not yet supported for web plugins.

Before your library or program can use the FFI library
to bind to native code, you must ensure that the
native code is loaded and its symbols are visible to Dart.
This page focuses on compiling, packaging,
and loading macOS native code within a Flutter plugin or app.

This tutorial demonstrates how to bundle C/C++
sources in a Flutter plugin and bind to them using
the Dart FFI library on macOS.
In this walkthrough, you’ll create a C function
that implements 32-bit addition and then
exposes it through a Dart plugin named “native_add”.

Dynamic vs static linking