Skip to content
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

Add freezed annotation on SDK structs used through Dart bindings #910

Closed
wants to merge 1 commit into from

Conversation

erdemyerebasmaz
Copy link
Contributor

@dangeross
Copy link
Collaborator

@erdemyerebasmaz with v2 of the flutter_rust_bridge do we still need to do this?

@erdemyerebasmaz
Copy link
Contributor Author

flutter_rust_bridge

@dangeross I'm not exactly sure if v2 changes would also generate toString methods without these annotations.

  • Use arbitrary Rust and Dart types without manual intervention, even if they are not serializable or non-clone.
  • Generate hashCode/equals for non-freezed structs.

I'll setup an example project using v2 to find out.

- All SDK structs exposed through Dart bindings that reference another SDK struct has to be annotated. Including the referenced struct.

- Not needed on structs that only has supported types so enums are excluded.
https://cjycode.com/flutter_rust_bridge/v1/feature/lang_simple.html
@roeierez
Copy link
Member

roeierez commented Apr 5, 2024

@erdemyerebasmaz it seems that v2 also supports structure errors so we should consider seriously to upgrade.

@erdemyerebasmaz
Copy link
Contributor Author

@erdemyerebasmaz it seems that v2 also supports structure errors so we should consider seriously to upgrade.

I didn't want to upgrade yet as it's in beta and we were getting ready for releasing c-breez. I'll look into it.

Should we merge this as there's an open PR on C-Breez that depends on this?

@erdemyerebasmaz
Copy link
Contributor Author

Superseded by #940

@erdemyerebasmaz erdemyerebasmaz deleted the freezed_annotation branch May 27, 2024 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants