mirror of
https://github.com/jlengrand/compose-multiplatform.git
synced 2026-05-12 00:01:20 +00:00
* move to kotlin 1.6.10-RC and corresponding compose commit * Update path to the karma plugin we are patching * Add ExperimentalComposeWebStyleApi what worries me that this actually shows that there are some cases where without any changes apart version compiler people will have to worry about such annotations * update kotlin version in templates to adopt 1.6.10-RC * web: move ComposableWithNullableTypeParameter.kt to passing test cases * update kotlin version in other places * update imageviewer example: add OptIn for experimental API * move compose * move to kotlin 1.6.10 and corresponding compose * move to kotlin 1.6.10 and corresponding compose * move to 1.0.1-rc2 * move to 1.0.1-rc2 (todoapp) Co-authored-by: Oleksandr Karpovich <oleksandr.karpovich@jetbrains.com> Co-authored-by: Shagen Ogandzhanian <shagen.ogandzhanian@jetbrains.com>
An example of Kotlin Multiplatform todo app with shared Android/Desktop Compose UI and SwiftUI (not Compose) iOS.
This example supports the following targets:
Android(Compose)Desktop/JVM(Compose)Web/JavaScript(Compose)iOS(SwiftUI, not Compose)
Libraries used:
- Jetpack Compose - shared UI
- Decompose - navigation and lifecycle
- MVIKotlin - presentation and business logic
- Reaktive - background processing and data transformation
- SQLDelight - data storage
There are multiple modules:
:common:utils- just some useful helpers:common:database- SQLDelight database definition:common:main- displays a list of todo items and a text field:common:edit- accepts an item id and allows editing:common:root- navigates betweenmainandeditscreens:common:compose-ui- Shared Compose UI for Android and Desktop:android- Android application:desktop- Desktop application:web- Web browser application + Compose Web UIios- iOS Xcode project
The root module is integrated into Android, Desktop and iOS (non-Compose) apps.
Features:
- 99% of the code is shared: data, business logic, presentation, navigation and UI
- View state is preserved when navigating between screens, Android configuration change, etc.
- Model-View-Intent (aka MVI) architectural pattern
- Pluggable UI - Compose UI for Android, Desktop and Web, SwiftUI (not Compose) for iOS
Running desktop application
./gradlew :desktop:run
Building native desktop distribution
./gradlew :desktop:package
# outputs are written to desktop/build/compose/binaries
Running Android application
Open project in Intellij IDEA or Android Studio and run "android" configuration.
Running Web browser application
./gradlew :web:jsBrowserDevelopmentRun
Running iOS application
Open and build the Xcode project located in ios folder.
