Hi all
Has anyone built a CMP project with two variants such as admin and user panel. I need to provide some different screens in each variant.
I'm familiar with Android and implemented it before but don't know how to do the same in KMP and how to structure the main composeApp to include a directory for each variant.
d
Damilola Akinterinwa
07/25/2024, 3:36 PM
I will advice you to create different project for each admin and user
👍 1
n
Nermeen
07/25/2024, 3:54 PM
I hope to find a way. I don't want to repeat some parts of the code.
c
chrisjenx
07/25/2024, 6:39 PM
I would create different projects, trust me, however, create shared libraries for shared code.
The main reason is deployment and config gets reallllly messy if you have multiple "apps" from a single project. Really one of the worst things they did with androidTargets which makes it difficult to configure vs java projects
👍 1
chrisjenx
07/25/2024, 6:43 PM
So for example I'm about to do the same for one of my projects, the admin portal will probably be web/desktop only where as customer facing is everything. You just force yourself to support more targets you don't need to otherwise.
But auth/endpoints/http/models all shared
👍 1
n
Nermeen
07/25/2024, 7:03 PM
Thank you @chrisjenx@Damilola Akinterinwa
I'll take your advice into account. I'm struggling with the starting point. I think it will be complicated
c
chrisjenx
07/25/2024, 7:15 PM
yeah, not going to lie it's not a simple task, I would deffo use the output of the template creators. theres an kotlin one I think
p
Pablichjenkov
07/25/2024, 9:24 PM
You can use different Gradle modules which depend on a common abstraction module. Then each one implements these abstractions differently. You then decide which module to pick at build time, when you build one App or the other