Skip to content

Chaintech-Network/KMP-Navigation-Demo

Repository files navigation

KMP(Kotlin Multi Platfrom) Demo

This SampleApp is built with Compose multiplatform based on MVVM architecture, which covers

  • Coroutines
  • Navigation
  • Flow
  • Material3
  • Koin
  • Api Calling
  • Network Image Loading
  • Kotlin Serialization
MIN_Video.1.1.mp4

Open-source libraries Used in this Demo

Other

  • Logger: Kotlin multi platform logging
  • Webview: for web url loading
  • Bottomsheet
  • Resources: (Use custom fonts, add images(png,xml), Use string resources with multi language)

for networking:

https://api.thecatapi.com/v1/images/search?limit=20

Voyager

For bottomTab navigation, screen navigation, bottomSheet Navigation follow below

Step:1

commonMain

// Multiplatform
// Navigator
implementation("cafe.adriel.voyager:voyager-navigator:$voyagerVersion")
// BottomSheetNavigator
implementation("cafe.adriel.voyager:voyager-bottom-sheet-navigator:$voyagerVersion")
// TabNavigator
implementation("cafe.adriel.voyager:voyager-tab-navigator:$voyagerVersion")
// Transitions
implementation("cafe.adriel.voyager:voyager-transitions:$voyagerVersion")

Step:2

-> Core Logic

-> Initialization

-> Usage

ImageLoader

api("io.github.qdsfdhvh:image-loader:1.6.7")

Example ImageView.kt

Ktor

commonMain

implementation("io.ktor:ktor-client-core:2.3.6")
implementation("io.ktor:ktor-client-content-negotiation:2.3.6")
implementation("io.ktor:ktor-client-logging:2.3.6")
api("io.ktor:ktor-serialization-kotlinx-json:2.3.6")

androidMain

implementation("io.ktor:ktor-client-android:2.3.3")
implementation("io.ktor:ktor-client-okhttp:2.3.3")

iOSMain

implementation("io.ktor:ktor-client-darwin:2.3.3")

For Api calling Follow

Serialization

commonMain

implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0")

Example

Koin

commonMain

implementation("io.insert-koin:koin-core:3.4.3")
implementation("io.insert-koin:koin-compose:1.0.4")

androidMain

implementation("io.insert-koin:koin-android:3.4.3")

String Resources

Follow StringRes.kt

CustomFont

Add font in commonMain -> resources (if not create)-> create font directory and add fonts

Example

Drawable

Add font in commonMain -> resources (if not create)-> add images

Example

Follow us on Linkedin for more such useful content

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published