-
Notifications
You must be signed in to change notification settings - Fork 70
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
Guide to using Crux with Flutter #78
Comments
This sounds like a great idea! I've not done any Flutter but would be well up for trying. If you would like to contribute an example, or add Flutter to one of the existing examples then please feel free to. Otherwise we'll definitely do this soon. |
@StuartHarris I highly appreciate your efforts to support flutter! I am not deep enough into either project, but happy to help! |
@patmuk thank you so much! 👍 I'll have a play with it over the weekend and let's see if we can get it in :-) |
@StuartHarris I am glad I can help :) I had a try myself today to combine both. See the three new commits in the linked project.
So, the initial commit is flutter-rust-bridge only, and works. I did not touch the flutter app - did not try to use the crux generated files here. Maybe this is the next step, and not the flutter-rust-bridge codegen. Got too tired now to think straight though - wish you success!! |
:-) Thanks @patmuk , yeah I got to the same point earlier in the week. I'm getting further with owned types (i.e. |
Hi @StuartHarris, |
Thanks Patrick! I got quite far with this, but then hit a wall. The problem I'm seeing is that it's not as straightforward as I thought to deserialise the list of Requests (effects) we get back from the core (simply because they're in a list). As well as learning some Dart and Flutter, which has been useful, it's also prompted us to work backwards a bit and rethink how we do this in general. I'm going to keep this on the back burner for a week or two while we have a look at how we hide this detail (serialisation and deserialisation). |
Hey, I didn't use any de/serialisation. I am not deep enough into "zero copy" - I know that serde can do that. flutter_rust_bridge is not using serde, and has zero copy for streams. While serialising is more interoperable, I was wondering if mapping the types wouldn't be more practical? I for one plan to do all UIs in Flutter. Nevertheless, I hope my code helps you to either progress in making crux compatible to flutter - or be more confirmed in your design! Let me know if I can do something to help further. And many thanks for the concept! |
I really love the idea of crux and currently I am building an app with flutter and would like to introduce crux as the core. May I know how this issue goes and any plan to officially support dart/Flutter on Crux ? |
Oh this would be wonderful! |
Bumping this as this would be really helpful! |
I'd personally love it, if someone who knows Dart quite well had a go at making one of the examples work. As far as I can tell without really looking at it closely, and @StuartHarris and @patmuk can keep me honest here - there are two main challenges to figure out:
If someone would like to pick this up and run with it, we'd be very happy to support however we can, but please be aware it's not the most trivial thing to make happen. |
Again, please excuse my late reply! As mentioned before, I implemented Rust <-> Flutter with Flutter-Rust-Bridge (FRB), but in the concept of crux. @charypar AFAIK you are right that crux utilizes serde-reflect. FRB does this different: They use FFI-gen to create the dart classes from rust - I think it is done here. Binding the rust lib into a iOS/Android binary is done with cargokit. I hope this helps! I hope my mentioning of FRB here is ok. As I see it, the projects are quite different: Crux offers multiple integrations, but the event-driven concept has to be followed (which implementation I like a lot!), while FRB is a one-trick pony integrating only rust and Flutter - but is totally open how you do that conceptually (any dart/rust function can be called from either side). |
There are no docs for using Crux with Flutter. Based on Crux's architecture, this should be relatively easy, since Flutter can take over UI, replacing 3 platform languages and their respective UI frameworks, allowing Crux to handle the core of the logic in the app. All Flutter would have to do is react to and trigger events. Would you have any thoughts on how to do this / get started?
The text was updated successfully, but these errors were encountered: