Observer pattern on boundary of Rust/Dart #1775
Unanswered
Corban-Dallas
asked this question in
Q&A
Replies: 1 comment
-
Feel free to PR to implement it! It may be translated to an (abstract) class on the dart side.
What about using https://cjycode.com/flutter_rust_bridge/guides/direction/rust-call-dart |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Greetings!
I am stuck on the problem of implementing an event-subscription interface between Rust and Dart. What I am trying to achieve is to implement something similar to the Observer or Delegate pattern, with an event provider on the Rust side and observers on the Dart side, hidden by a trait.
It seems that it is currently impossible for the bridge to work with traits. I am certain that I should change my approach and move away from using traits, opting for something alternative but similar. The
DartOpaque
coming in mind, but for rust side it is just almost like a raw pointer without real interface, isn't it?Due to my lack of experience with Rust, I am struggling to come up with a good idea. Perhaps someone can share some good ideas or there are already well-known practices for solving this problem?
psuedo code of desired bridge interface behavior
Beta Was this translation helpful? Give feedback.
All reactions