Skip to content

EdoardoVignati/dart-ffi-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dart FFI example

Here is a Flutter example with a Dart plugin written in C++

Reference manual: https://docs.flutter.dev/development/platform-integration/c-interop

This is an implementation of the native_add function as described in the manual above.

First of all, clone this repository

If you are running on Xcode you need must statically link the library as described in Section 2 of the manual

If you are using Android, open this repository in AndroidStudio and launch example/lib/main.dart on an Android Emulator

The build process of the example app may take a long time.

Troubleshooting

On Ubuntu:

fatal error: 'gnu/stubs-32.h' file not found

Fix: