Migrate from Cargokit to Native Assets
Native Assets changes how the Rust library is built and bundled; the Rust and Dart APIs stay unchanged.
Migrate
Run the integration command from the Flutter package root:
flutter_rust_bridge_codegen integrate --integration-backend native-assetsCheck the generated
hook/build.dartand the Rust crate requirements.Remove the old Cargokit integration:
- Apps: Remove
rust_builder/, itspubspec.yamlpath dependency, and itsanalysis_options.yamlexclusion. - Packages: Remove
cargokit/and the Flutter plugin entries used only by the oldffiPluginscaffold.
- Apps: Remove
Refresh dependencies and regenerate the bridge:
flutter pub get
flutter_rust_bridge_codegen generate
Keep the Rust crate, generated bridge code, and your own Dart and Rust code. Test every platform supported by the project after migrating.