Open p0lloc opened 1 month ago
Hi! Thanks for opening your first issue here! :smile:
Hi, could you please try the https://cjycode.com/flutter_rust_bridge/guides/third-party. For your own case, https://cjycode.com/flutter_rust_bridge/guides/third-party/manual/external-types may be useful.
Thanks for the quick response! I have read the documentation for third-party crates but I can't seem to find more information regarding struct-like enums. Are they simply not supported with automatic scanning?
The documentation for mirroring with the manual approach states "It works with basic enums too. Enums with struct variants are not yet supported".
Hmm ok, then "mirroring Enums with struct variants" is not supported yet. A workaround is to copy-paste the definition to your first party crate. Also feel free to PR to support this new feature!
Describe the bug
The code generator does not generate concrete code for a struct-like enum defined in a third-party crate. It is left as an opaque type and cannot be constructed on the Dart side.
Steps to reproduce
flutter_rust_bridge_codegen generate
Logs
Expected behavior
A struct-like enum in the first-party crate:
generates the following Dart code:
I expected the same behavior for my third-party crate.
Generated binding code
No response
OS
No response
Version of
flutter_rust_bridge_codegen
No response
Flutter info
No response
Version of
clang++
No response
Additional context
No response