Dart frontend for UniFFI bindings
Add uniffi-dart as a dependency in your Cargo.toml:
[dependencies]
uniffi-dart = "0.2.0+v0.31.1"uniffi-dart includes a comprehensive test suite with 30 fixtures covering all major UniFFI functionality:
- Core Types: Primitives, collections, optionals, type limits
- Async Patterns: Comprehensive async/Future support with object-oriented patterns
- Error Handling: Error types, large errors, exception scenarios
- Object-Oriented: Interfaces, constructors, methods, traits
- Time Handling: Timestamps, durations, ISO 8601 formatting
- Performance: FFI call overhead benchmarking
- Documentation: UDL and proc-macro documentation generation
- External Types: Cross-crate type sharing and custom type wrapping
Run all fixture tests:
cargo nextest run --all --nocaptureRun specific fixture tests:
cargo nextest run -p simple_fns --nocapture
cargo nextest run -p dart_async --nocapture
cargo nextest run -p time_types --nocaptureFor nightly compiler features (genco whitespace detection):
cargo +nightly nextest run -p hello_world --nocaptureOur comprehensive fixture suite has identified 5 critical blocking features:
- HashMap/Map support - Core collection type missing
- Proc-macro support - Modern UniFFI development pattern
- Dictionary default values - Named parameters with defaults
- Trait method support - Advanced trait functionality
- BigInt support - Large integer boundary handling
uniffi-dart is versioned independently from uniffi-rs. We follow the SemVer rules from the Cargo Book where versions are compatible when their left-most non-zero component matches. A breaking change is any modification to the generated Dart bindings that requires consumers to update their code.
Because the project is still young, the major version is 0 and most updates bump the minor version.
To keep binding generators in sync, uniffi-dart targets a specific uniffi-rs release. If you use multiple external binding generators, pick versions that target the same uniffi-rs version.
Tags follow the format vX.Y.Z+vA.B.C, where X.Y.Z is the
uniffi-dart version and A.B.C is the targeted uniffi-rs version.
| uniffi-rs target | Latest uniffi-dart release |
|---|---|
| v0.31.1 | v0.2.0+v0.31.1 |
| v0.30.0 | v0.1.1+v0.30.0 |
The code is released under MIT License. See the LICENSE file in the repository root for details.
The project is building on top of the great work of Mozillas UniFFI, with inspirations from other external frontends (like Kotlin and Go) and with the help of the ffi-gen lib. Thanks folks!