redbadger / crux

Cross-platform app development in Rust
https://redbadger.github.io/crux/
Apache License 2.0
1.68k stars 58 forks source link

How the multiscreen app can be design #262

Open Neerajsh8851 opened 1 month ago

Neerajsh8851 commented 1 month ago

What would be the design of the shell and core for multi screen application ??

charypar commented 1 month ago

It's quite an open ended question, could you elaborate on what you mean? An app with multiple screens which can be navigated between, or an app which runs across multiple physical screens?

What's true for both is that the view model needs to capture what's going on screen in a way the UI can easily pick up and use - its structure should follow the sructure of the UI.

If you can share details of some specific challenges you're facing, it will be easier for us to help.

Neerajsh8851 commented 1 month ago

I am talking about navigation in the app. My app would have multiple screens so how will the navigation happen? Core request to the ui using render capabilty that means core decides's what to show on the device screen. I did not understand how the navigation work with rust crux.

charypar commented 1 month ago

Have a read through the Tap to pay example https://github.com/redbadger/crux/tree/master/examples/tap_to_pay, that does multi-screen navigation.

It uses SwiftUI to turn a basic description in the view model of what screen should be shown (there's an enum for the different screens) to the UI that should be on screen - like a NavigationStack a sheet and a fullScreenCover.