A new Flutter project.
-
Install Flutter, be sure to also follow the instructions for the platform you want to build for, i.e. enable desktop support or set up Android SDK (all described on the same page). At the moment, the following targets are supported: Linux, Windows, Android
-
- Android only:
-
Add Android targets for cross-compilation
rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android i686-linux-android
-
Point cargo to the linker provided by Android NDK, a helper script for generating the necessary configuration is provided in tool/cargo-config-gen-android.sh, append the output to your cargo configuration file, e.g. by:
ANDROID_NDK_HOME="path/to/ndk/version" ANDROID_API="30" bash ./tool/cargo-config-gen-android.sh >> ~/.cargo/config.toml
-
- Android only:
-
Clone the repository with submodules:
git clone --recurse-submodules https://github.com/crocs-muni/meesign-client
-
Build the app:
flutter build
or run it directly:
flutter run
If you modify native libraries in lib-native, update Dart bindings by running:
flutter pub run ffigen --config ffigen/changed-lib.yaml
This regenerates the files as specified by the provided ffigen configuration. (Note that ffigen requires LLVM.)
If you modify a file in proto, regenerate the Dart gRPC code:
-
Install Protocol buffers compiler
-
Install Dart plugin for protoc:
flutter pub global activate protoc_plugin
Note the path to the plugin executable or make sure it is available through
PATH
. -
Generate Dart code:
protoc --experimental_allow_proto3_optional --plugin=/path/to/bin/protoc-gen-dart --dart_out=grpc:lib/grpc/generated/ -I proto proto/mpc.proto