website/v1_mdbook/src/library/setup.md
To start developing your Dart/Flutter library, you will need to download some dependencies locally.
The rest of this guide assumes you have the following tools installed on any development machines:
dart pub global activate melos to install once Dart/Flutter are installedIf you would like to build your binaries (for Flutter devices) locally in addition to CI (say, to test on a real device or emulator), you will additionally need the following:
cargo-ndk
r21e) was the only one that could be used easily
r25b) was working at the time of writing this documentationclang-cl!)
brew install llvm on macOS since Apple's llvm doesn't have itWe will be using the following structure for our repository, assuming our library name is library_name:
.github/ for CI/CD (with GitHub Actions) & dependabotpackages/ where our Flutter/Dart packages will live
library_name/ the Dart-only (library) package using flutter_rust_bridge (FRB)
native/ the Rust library used by Darttest/ unit tests for our Dart-only libraryexample/ an example project showing how to use library_name from Dart-only
test/ (optional) tests for the example; can be used to ensure example continues to work in CIflutter_library_name/ the Flutter (library) package wrapping around library_name for ease of use
android/, ios/, linux/, macos/, & windows/ for platform-specific wrappers in order to bundle our library binaries with Flutter applicationstest/ unit tests for our Flutter library (note: there might not be any if your Flutter library does not add any Flutter-specific functionality; in that case, add a dummy test in so CI is happy)example/ an example project showing how to use flutter_library_name from within a Flutter application
integration_test/ integration tests to ensure your Flutter library, example, and platform-specific configuration are all working together correctlyscripts/ build Flutter binaries and handle release creationplatform-build/ the output (build) folder for all created Flutter binariesanalysis_options.yaml to enable consistent Dart analysis in our Dart/Flutter librariesCargo.toml so IDEs can find our Rust project under packages/library_name/nativemelos.yaml to configure the monorepo, see more here