Skip to content

Instantly share code, notes, and snippets.

View ykmnkmi's full-sized avatar
🎯
Focusing

Olzhas Suleimen ykmnkmi

🎯
Focusing
  • Kazakhstan, Almaty
  • 22:23 (UTC +05:00)
View GitHub Profile
@ykmnkmi
ykmnkmi / flutter-ffi-async-nativeport.md
Created June 26, 2023 09:32 — forked from espresso3389/flutter-ffi-async-nativeport.md
Async messaging between Flutter and C++ using Dart ffi NativePort

C++

  • Copy Dart SDK (${FLUTTER_DIR}/bin/cache/dart-sdk/include) to your project, e.g. ios/Classes/
  • Add your own code like the following fragment
#include "dart_api_dl.h"

// Receives NativePort ID from Flutter code
static Dart_Port_DL dart_port = 0;