-
Notifications
You must be signed in to change notification settings - Fork 307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicating classes generated when use flutter_rust_bridge_codegen
with cross dependency
#2497
Comments
Another question about |
You are welcome! Yes it would be easier if there is only one single Rust crate. Maybe there can be a single
Btw curious why do you want to ignore it?
IIRC there is no such feature now, but feel free to PR for it! The workaround may be e.g. do not ignore it (and just do not use it) |
The
The problem is that I want to declare FFI methods in a flutter library, which needs some generated dart code; and then the flutter app depends on the library cannot do generating again. |
I see. Not sure but if that function is never touched or used, I wonder maybe it will not cause harm
Hmm, then is it possible to make the flutter lib do everything related to frb, and the flutter app do nothing about frb |
Greetings and thanks for answering my previous issue.
First, I have rust crate
rust-library
and a corresponding flutter libraryflutter-library
.Some FFIs between
rust-library
andflutter-library
are generated byflutter_rust_bridge_codegen
.For example, in
rust-library
:In
flutter-library
:Then, I add a
flutter-app
depends onflutter-library
, with a rust craterust-app
depends onrust-library
.flutter-app
needs to add FFIs withrust-app
, which would use structs in bothrust-app
andrust-library
.However, if I use
flutter_rust_bridge_codegen
to generate FFIs forrust-app
depending onrust-library
, some structs inrust-library
would be generated again.It's like in
rust-app
:In
flutter-app
:Obviously the two
Data
classes are duplicating.Beyond this, there are also some issues about handlers and library loading.
What should I do with this cross-dependency?
It seems
flutter_rust_bridge_codegen
should be used only once in a project.Thus I should not use FFI in
flutter-library
?The text was updated successfully, but these errors were encountered: