fzyzcjy / flutter_rust_bridge

Flutter/Dart <-> Rust binding generator, feature-rich, but seamless and simple.
https://fzyzcjy.github.io/flutter_rust_bridge/
MIT License
4.17k stars 288 forks source link

[experimental-feature] rust_input version specification #2311

Open poborin opened 6 days ago

poborin commented 6 days ago

I have a project that uses tungstenite. There are a few dependencies that are using different versions: tungstenite@0.20.1 tungstenite@0.21.0 tungstenite@0.24.0

When I add a tungstenite crate to a rust_input parameter in flutter_rust_bridge.yaml, the generate command fails with the following error:

There are multiple `tungstenite` packages in your project, and the specification `tungstenite` is ambiguous.
Please re-run this command with one of the following specifications:
  tungstenite@0.20.1
  tungstenite@0.21.0
  tungstenite@0.24.0

Describe the solution you'd like I can specify a version in the flutter_rust_bridge.yaml as such:

rust_input: crate::api, tungstenite@0.24.0
welcome[bot] commented 6 days ago

Hi! Thanks for opening your first issue here! :smile:

fzyzcjy commented 6 days ago

Looks reasonable and feel free to PR for this! (Since this is experimental feature, I may not have a lot of time to handle this soon.)

Btw, briefly looked at https://github.com/snapview/tungstenite-rs, and I guess the syntax may (or may not) be too complex to be auto scanned. Thus, I suggest to firstly create an empty project and try whether frb can handle that package, and if yes, work on the multi-version thing.