Skip to content

breez/sdk-workshop-flutter-plugin

Repository files navigation

sdk-flutter

A flutter plugin project that exposes the sdk-core using ffi. The flutter_rust_bridge is used to generate the bindings.

Build

Prerequisites:

  • set the ANDROID_NDK_HOME env variable to your sdk home folder
export ANDROID_NDK_HOME=<your android ndk directory>
  • MacOS, using Homebrew
brew install brew install protobuf
  • Linux
apt install -y protobuf-compiler
  • install cargo-ndk to provide simplified android build:
cargo install cargo-ndk
cargo install flutter_rust_bridge_codegen --version 1.69.0

Building the plugin

On first usage you will need to run:

make init

Then for iOS:

make ios

And for android

make android

Generated artifacts:

  • Android libraries
  • android/src/main/jniLibs/arm64-v8a/libbreez_sdk_core.so
  • android/src/main/jniLibs/armeabi-v7a/libbreez_core_sdk.so
  • android/src/main/jniLibs/x86/libbreez_sdk_core.so
  • android/src/main/jniLibs/x86_64/libbreez_sdk_core.so
  • iOS library
  • ios/libbreez_sdk_core.a