Skip to content

How to send events between flutter and rust #2223

Answered by TibiToz
TibiToz asked this question in Q&A
Discussion options

You must be logged in to vote

I understood my mistake, I treated enum like structs.

I had to add #[frb(non_opaque)] on my enum and install freezed.

But it seems that freezed is getting a parsing error. Any ideas how to solve this issue ?

An error FormatterException occurred while formatting the generated source for
package:app/src/rust/api/discovery.dart
which was output to
lib/src/rust/api/discovery.freezed.dart.
This may indicate an issue in the generator, the input source code, or in the
source formatter.
Could not format because the source could not be parsed:

line 21, column 91 of .: Expected to find ')'.

21 │ @optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( Device field0) new,{require…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@fzyzcjy
Comment options

@TibiToz
Comment options

Answer selected by TibiToz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants