Workout Project written in Flutter and Rust.
Make sure you got cargo-make
installed (cargo install cargo-make
).
cargo make init
NOTE: We are using cbindgen
and dart-bindgen
as global commands. Using them as
dep-dependencies
instead via their API causes compile times of the project containing the
build.rs
to go up.
cargo make android
Similarly for ios
and macos
.
For example to start the app in a MacOS Desktop do:
flutter run -d "`flutter devices list | grep macOS | head -c5`"
Flutter app created via:
flutter create --platforms android,ios workout
Rust crates created via:
cargo new --lib native/workout
cargo new --lib native/workout-ffi
Flutter plugin package created via:
flutter create --platforms ios,android,macos --template=plugin packages/workout_ffi
Ensure to add the ffi
lib as a dependency of the plugin and then run:
(cd packages/workout_ffi && flutter pub get)
Modify ios setup to make things work, see this commit:
- ios/Classes/SwiftWorkoutFfiPlugin.swift
- ios/workout_ffi.podspec
In some cases it helps to run flutter clean
if the add
method (or whichever you are
exposing) is not found.