flutter create

-platforms

=macos

-template

=plugin native_add

cd native_add

Note:
  You can exclude platforms from --platforms that you don’t want
  to build to. However, you need to include the platform of 
  the device you are testing on.

Step 2: Add C/C++ sources

You need to inform the macOS build system about the
native code so the code can be compiled
and linked appropriately into the final application.

Add the sources to the macos folder,
because CocoaPods doesn’t allow including sources
above the podspec file.

The FFI library can only bind against C symbols,
so in C++ these symbols must be marked extern C.
You should also add attributes to indicate that the
symbols are referenced from Dart,
to prevent the linker from discarding the symbols
during link-time optimization.