diff --git a/README.md b/README.md
index 6e15d9e..dc0485e 100644
--- a/README.md
+++ b/README.md
@@ -108,17 +108,16 @@ Click to "Use This Template" button to create a new repository with this templat
Go to the [Documentation page](https://docs.multiplatformkickstarter.com) for all the information. (**WIP**)
-PRO Template
+Need a different template?
-----------------
-Do you need more? Adoptme is a good start but the **Pro template** have all you need to create professional apps without a hassle.
-It includes more features, screens and components. Like:
+Do you need a different use case? Adoptme Template is a good start but the are more **complete templates** that have all you need to create professional apps without a hassle.
+Including more features, screens and components. Like:
- Advanced CI (deployment)
-- A/B Component
-- Deeplinks
-- More Translations
-- Social Login
+- RSS Component
+- Read and Download PDFs
+- Built-in video-game
- 3rd party integrations
- **and more!**
@@ -171,7 +170,7 @@ Check out our social media to be up-to-date about new products, features and rel
License
-------
-Copyright 2023-2024 Multiplatform Kickstarter
+Copyright 2023-2025 Multiplatform Kickstarter
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/composeApp/build.gradle.kts b/composeApp/build.gradle.kts
index b2db400..c151347 100644
--- a/composeApp/build.gradle.kts
+++ b/composeApp/build.gradle.kts
@@ -41,7 +41,7 @@ kotlin {
androidTarget {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
- jvmTarget.set(JvmTarget.JVM_17)
+ jvmTarget.set(JvmTarget.JVM_21)
}
}
jvm("desktop")
@@ -151,8 +151,8 @@ android {
}
}
compileOptions {
- sourceCompatibility = JavaVersion.VERSION_17
- targetCompatibility = JavaVersion.VERSION_17
+ sourceCompatibility = JavaVersion.VERSION_21
+ targetCompatibility = JavaVersion.VERSION_21
}
buildFeatures {
compose = true
diff --git a/gradle.properties b/gradle.properties
index 17e0c3a..a4824f1 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,7 +1,9 @@
# Gradle
-org.gradle.jvmargs=-Xms8g -Xmx8g -XX:MaxMetaspaceSize=1g -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC
+org.gradle.jvmargs=-Xms8g -Xmx8g -XX:MaxMetaspaceSize=1g -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC -XX:-UseGCOverheadLimit
kotlin.daemon.jvmargs=-Xms4g -Xmx4g -XX:+UseParallelGC
org.gradle.caching=true
+kotlin.mpp.androidGradlePluginCompatibility.nowarn=true
+org.gradle.parallel=true
org.gradle.configuration-cache=true
@@ -32,5 +34,5 @@ kotlin.native.cachekind=none
# Multiplatform Kickstarter config
multiplatformkickstarter.version.major = 2
-multiplatformkickstarter.version.minor = 0
+multiplatformkickstarter.version.minor = 1
multiplatformkickstarter.version.patch = 0
\ No newline at end of file
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 039c198..380907e 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -1,29 +1,29 @@
[versions]
-android-compileSdk = "34"
+android-compileSdk = "35"
android-minSdk = "26"
-android-targetSdk = "34"
-kotlin = "2.0.0"
+android-targetSdk = "35"
+kotlin = "2.1.10"
ktor-client = "2.3.12"
ktor-server = "2.3.12"
multiplatform-settings = "1.0.0"
-voyager = "1.0.0"
-koin = "3.5.6"
-koin-compose = "1.1.3"
+voyager = "1.1.0-beta03"
+koin = "4.0.1"
+koin-compose = "4.0.1"
junit = "4.13.2"
-androidGradlePlugin = "8.5.1"
-composeMultiplatform = "1.6.11"
+androidGradlePlugin = "8.8.2"
+composeMultiplatform = "1.7.3"
exposed = "0.37.3"
-skiko = "0.8.4"
+skiko = "0.8.18"
ktlint = "11.5.1"
-detekt = "1.23.1"
-kotlinx-coroutines = "1.8.1"
+detekt = "1.23.7"
+kotlinx-coroutines = "1.10.2"
androidx-junit = "1.2.1"
espressoCore = "3.6.1"
-accompanistSystemuicontroller = "0.32.0"
-activityCompose = "1.9.0"
-firebase = "33.1.2"
+accompanistSystemuicontroller = "0.36.0"
+activityCompose = "1.10.1"
+firebase = "33.13.0"
touchlab = "2.0.5"
-navigationCommonKtx = "2.7.7"
+navigationCommonKtx = "2.8.9"
[libraries]
# Common
@@ -41,8 +41,8 @@ ktor-client = { module = "io.ktor:ktor-client-core", version.ref = "ktor-client"
kamel = "media.kamel:kamel-image:0.7.1"
kermit = "co.touchlab:kermit:2.0.0-RC5"
-kotlinx-serialization-json = "org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.1"
-kotlinx-datetime = "org.jetbrains.kotlinx:kotlinx-datetime:0.5.0"
+kotlinx-serialization-json = "org.jetbrains.kotlinx:kotlinx-serialization-json:1.8.1"
+kotlinx-datetime = "org.jetbrains.kotlinx:kotlinx-datetime:0.6.0"
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinx-coroutines" }
@@ -56,12 +56,12 @@ koin-core = { module = "io.insert-koin:koin-core", version.ref = "koin" }
koin-test = { module = "io.insert-koin:koin-test", version.ref = "koin" }
# Android
-compose-bom = "androidx.compose:compose-bom:2024.06.00"
+compose-bom = "androidx.compose:compose-bom:2025.01.00"
koin-android = { module = "io.insert-koin:koin-android", version.ref = "koin" }
-androidx-core-ktx = "androidx.core:core-ktx:1.13.1"
+androidx-core-ktx = "androidx.core:core-ktx:1.16.0"
androidx-core-splashscreen = "androidx.core:core-splashscreen:1.0.1"
-androidx-tracing-ktx = "androidx.tracing:tracing-ktx:1.2.0"
+androidx-tracing-ktx = "androidx.tracing:tracing-ktx:1.3.0"
accompanist-systemuicontroller = { module = "com.google.accompanist:accompanist-systemuicontroller", version.ref = "accompanistSystemuicontroller" }
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "activityCompose" }
firebase-bom = { module = "com.google.firebase:firebase-bom", version.ref = "firebase" }
@@ -83,9 +83,9 @@ stately-common = { module = "co.touchlab:stately-common", version.ref = "touchla
# Desktop
koin-compose = { module = "io.insert-koin:koin-compose", version.ref = "koin-compose" }
-kotlinx-coroutines-swingui = "org.jetbrains.kotlinx:kotlinx-coroutines-swing:1.8.1"
+kotlinx-coroutines-swingui = "org.jetbrains.kotlinx:kotlinx-coroutines-swing:1.10.2"
ktor-client-java = { module = "io.ktor:ktor-client-java", version.ref = "ktor-client" }
-androidx-compose-ui-util = "androidx.compose.ui:ui-util:1.6.8"
+androidx-compose-ui-util = "androidx.compose.ui:ui-util:1.7.5"
# Backend
ktor-server-core = { module = "io.ktor:ktor-server-core", version.ref = "ktor-server" }
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index b82aa23..e2847c8 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
diff --git a/iosApp/iosApp/Info.plist b/iosApp/iosApp/Info.plist
index ff826b7..5252597 100644
--- a/iosApp/iosApp/Info.plist
+++ b/iosApp/iosApp/Info.plist
@@ -2,6 +2,8 @@
+ CADisableMinimumFrameDurationOnPhone
+
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts
index 02ea81f..1d71306 100644
--- a/shared/build.gradle.kts
+++ b/shared/build.gradle.kts
@@ -28,7 +28,7 @@ kotlin {
androidTarget {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
- jvmTarget.set(JvmTarget.JVM_17)
+ jvmTarget.set(JvmTarget.JVM_21)
}
}
@@ -123,8 +123,11 @@ android {
minSdk = libs.versions.android.minSdk.get().toInt()
}
compileOptions {
- sourceCompatibility = JavaVersion.VERSION_17
- targetCompatibility = JavaVersion.VERSION_17
+ sourceCompatibility = JavaVersion.VERSION_21
+ targetCompatibility = JavaVersion.VERSION_21
+ }
+ kotlin {
+ jvmToolchain(21)
}
}
diff --git a/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/feature/debugmenu/DebugMenuScreen.kt b/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/feature/debugmenu/DebugMenuScreen.kt
index 55cc738..4c2936f 100644
--- a/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/feature/debugmenu/DebugMenuScreen.kt
+++ b/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/feature/debugmenu/DebugMenuScreen.kt
@@ -15,8 +15,6 @@ import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
-import androidx.compose.material.icons.Icons
-import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material3.Button
import androidx.compose.material3.Checkbox
import androidx.compose.material3.CheckboxColors
@@ -45,7 +43,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import cafe.adriel.voyager.core.screen.Screen
-import cafe.adriel.voyager.koin.getScreenModel
+import cafe.adriel.voyager.koin.koinScreenModel
import cafe.adriel.voyager.navigator.LocalNavigator
import cafe.adriel.voyager.navigator.currentOrThrow
import com.multiplatformkickstarter.app.feature.debugmenu.viewmodel.DebugMenuSideEffects
@@ -74,7 +72,7 @@ class DebugMenuScreen : Screen {
val snackbarHostState = remember { SnackbarHostState() }
showingModal = remember { mutableStateOf(false) }
- val viewModel = getScreenModel()
+ val viewModel = koinScreenModel()
SetupSideEffects(viewModel)
DebugMenuView(viewModel, snackbarHostState) {
@@ -139,7 +137,7 @@ class DebugMenuScreen : Screen {
),
navigationIcon = {
IconButton(onClick = { onClose.invoke() }) {
- Icon(imageVector = Icons.AutoMirrored.Filled.ArrowBack, contentDescription = "Go back")
+ Icon(imageVector = MultiplatformKickstarterIcons.ArrowBack, contentDescription = "Go back")
}
}
)
diff --git a/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/feature/loginsignup/EmailLoginScreen.kt b/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/feature/loginsignup/EmailLoginScreen.kt
index a4a5090..ce67c7c 100644
--- a/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/feature/loginsignup/EmailLoginScreen.kt
+++ b/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/feature/loginsignup/EmailLoginScreen.kt
@@ -11,8 +11,6 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.KeyboardOptions
-import androidx.compose.material.icons.Icons
-import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.ExperimentalMaterial3Api
@@ -38,7 +36,7 @@ import androidx.compose.ui.text.input.PasswordVisualTransformation
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.unit.dp
import cafe.adriel.voyager.core.screen.Screen
-import cafe.adriel.voyager.koin.getScreenModel
+import cafe.adriel.voyager.koin.koinScreenModel
import cafe.adriel.voyager.navigator.LocalNavigator
import cafe.adriel.voyager.navigator.currentOrThrow
import com.multiplatformkickstarter.app.feature.loginsignup.viewmodels.EmailLoginSideEffects
@@ -60,7 +58,7 @@ class EmailLoginScreen : Screen {
MultiplatformKickstarterTheme {
val localization = getCurrentLocalization()
val snackbarHostState = remember { SnackbarHostState() }
- val viewModel = getScreenModel()
+ val viewModel = koinScreenModel()
SetupSideEffects(viewModel, snackbarHostState, localization)
EmailLoginView(viewModel, snackbarHostState, localization)
@@ -123,7 +121,7 @@ fun EmailLoginView(viewModel: EmailLoginViewModel, snackbarHostState: SnackbarHo
navigationIcon = {
IconButton(onClick = { currentNavigator.pop() }) {
Icon(
- imageVector = Icons.AutoMirrored.Filled.ArrowBack,
+ imageVector = MultiplatformKickstarterIcons.ArrowBack,
contentDescription = localization.backLabel
)
}
diff --git a/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/feature/loginsignup/EmailSignUpScreen.kt b/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/feature/loginsignup/EmailSignUpScreen.kt
index 0579769..a8241a0 100644
--- a/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/feature/loginsignup/EmailSignUpScreen.kt
+++ b/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/feature/loginsignup/EmailSignUpScreen.kt
@@ -11,8 +11,6 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.KeyboardOptions
-import androidx.compose.material.icons.Icons
-import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.ExperimentalMaterial3Api
@@ -38,7 +36,7 @@ import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import cafe.adriel.voyager.core.screen.Screen
-import cafe.adriel.voyager.koin.getScreenModel
+import cafe.adriel.voyager.koin.koinScreenModel
import cafe.adriel.voyager.navigator.LocalNavigator
import cafe.adriel.voyager.navigator.currentOrThrow
import com.multiplatformkickstarter.app.feature.loginsignup.viewmodels.EmailSignUpSideEffects
@@ -60,7 +58,7 @@ class EmailSignUpScreen : Screen {
MultiplatformKickstarterTheme {
val localization = getCurrentLocalization()
val snackbarHostState = remember { SnackbarHostState() }
- val viewModel = getScreenModel()
+ val viewModel = koinScreenModel()
SetupSideEffects(viewModel, snackbarHostState)
EmailSignUpView(viewModel, snackbarHostState, localization)
@@ -111,7 +109,7 @@ fun EmailSignUpView(viewModel: EmailSignUpViewModel, snackbarHostState: Snackbar
navigationIcon = {
IconButton(onClick = { currentNavigator.pop() }) {
Icon(
- imageVector = Icons.AutoMirrored.Filled.ArrowBack,
+ imageVector = MultiplatformKickstarterIcons.ArrowBack,
contentDescription = localization.backLabel
)
}
diff --git a/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/feature/loginsignup/LoginSignUpLandingScreen.kt b/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/feature/loginsignup/LoginSignUpLandingScreen.kt
index a198bd4..456daa8 100644
--- a/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/feature/loginsignup/LoginSignUpLandingScreen.kt
+++ b/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/feature/loginsignup/LoginSignUpLandingScreen.kt
@@ -13,8 +13,6 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
-import androidx.compose.material.icons.Icons
-import androidx.compose.material.icons.filled.Close
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.ExperimentalMaterial3Api
@@ -36,6 +34,7 @@ import cafe.adriel.voyager.navigator.currentOrThrow
import com.multiplatformkickstarter.app.localization.getCurrentLocalization
import com.multiplatformkickstarter.app.resources.Res
import com.multiplatformkickstarter.app.resources.cat_dog
+import com.multiplatformkickstarter.app.ui.icon.MultiplatformKickstarterIcons
import com.multiplatformkickstarter.app.ui.theme.MultiplatformKickstarterTheme
import com.multiplatformkickstarter.app.ui.theme.Typography
import org.jetbrains.compose.resources.vectorResource
@@ -61,7 +60,7 @@ fun LoginSignUpView() {
navigationIcon = {
IconButton(onClick = { currentNavigator.pop() }) {
Icon(
- imageVector = Icons.Filled.Close,
+ imageVector = MultiplatformKickstarterIcons.Close,
contentDescription = localization.backLabel
)
}
diff --git a/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/feature/pets/MyPetsScreen.kt b/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/feature/pets/MyPetsScreen.kt
index 55c7a1d..df0bf1b 100644
--- a/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/feature/pets/MyPetsScreen.kt
+++ b/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/feature/pets/MyPetsScreen.kt
@@ -28,7 +28,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import cafe.adriel.voyager.core.screen.Screen
-import cafe.adriel.voyager.koin.getScreenModel
+import cafe.adriel.voyager.koin.koinScreenModel
import cafe.adriel.voyager.navigator.LocalNavigator
import cafe.adriel.voyager.navigator.currentOrThrow
import com.multiplatformkickstarter.app.feature.pets.viewmodels.MyPetsViewModel
@@ -46,7 +46,7 @@ class MyPetsScreen : Screen {
val localization = getCurrentLocalization()
val navigator = LocalNavigator.currentOrThrow
- val viewModel = getScreenModel(
+ val viewModel = koinScreenModel(
parameters = { ParametersHolder(listOf(navigator).toMutableList(), false) }
)
MyPetsScreenView(viewModel, localization) {
diff --git a/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/feature/petupload/PetUploadScreen.kt b/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/feature/petupload/PetUploadScreen.kt
index 498508b..ae1e6bb 100644
--- a/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/feature/petupload/PetUploadScreen.kt
+++ b/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/feature/petupload/PetUploadScreen.kt
@@ -46,7 +46,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.unit.dp
import cafe.adriel.voyager.core.screen.Screen
-import cafe.adriel.voyager.koin.getScreenModel
+import cafe.adriel.voyager.koin.koinScreenModel
import cafe.adriel.voyager.navigator.LocalNavigator
import cafe.adriel.voyager.navigator.currentOrThrow
import com.multiplatformkickstarter.app.common.model.GeoLocation
@@ -87,7 +87,7 @@ class PetUploadScreen : Screen {
val snackbarHostState = remember { SnackbarHostState() }
showingModal = remember { mutableStateOf(false) }
- val viewModel = getScreenModel()
+ val viewModel = koinScreenModel()
SetupSideEffects(viewModel, snackbarHostState, localization)
PetUploadView(viewModel, snackbarHostState) {
diff --git a/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/feature/profile/ProfileDetailScreen.kt b/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/feature/profile/ProfileDetailScreen.kt
index e5d9d32..951eee0 100644
--- a/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/feature/profile/ProfileDetailScreen.kt
+++ b/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/feature/profile/ProfileDetailScreen.kt
@@ -19,8 +19,6 @@ import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
-import androidx.compose.material.icons.Icons
-import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
@@ -30,6 +28,7 @@ import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBar
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.runtime.Composable
+import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
@@ -37,9 +36,8 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
-import cafe.adriel.voyager.core.lifecycle.LifecycleEffect
import cafe.adriel.voyager.core.screen.Screen
-import cafe.adriel.voyager.koin.getScreenModel
+import cafe.adriel.voyager.koin.koinScreenModel
import cafe.adriel.voyager.navigator.LocalNavigator
import cafe.adriel.voyager.navigator.currentOrThrow
import com.multiplatformkickstarter.app.feature.profile.viewmodels.ProfileDetailViewModel
@@ -63,15 +61,14 @@ class ProfileDetailScreen(val userId: Int) : Screen {
override fun Content() {
MultiplatformKickstarterTheme {
val currentNavigator = LocalNavigator.currentOrThrow
- val viewModel = getScreenModel(
+ val viewModel = koinScreenModel(
parameters = { ParametersHolder(listOf(userId, currentNavigator).toMutableList(), false) }
)
- LifecycleEffect(
- onStarted = {
- viewModel.onStarted()
- }
- )
+ DisposableEffect(key) {
+ viewModel.onStarted()
+ onDispose {}
+ }
ProfileDetailView(viewModel, localization) {
currentNavigator.pop()
@@ -95,7 +92,7 @@ class ProfileDetailScreen(val userId: Int) : Screen {
TopAppBar(
navigationIcon = {
IconButton(onClick = { onClose.invoke() }) {
- Icon(imageVector = Icons.Filled.ArrowBack, contentDescription = "Go back")
+ Icon(imageVector = MultiplatformKickstarterIcons.ArrowBack, contentDescription = "Go back")
}
},
title = {},
diff --git a/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/ui/components/PetsSearchBar.kt b/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/ui/components/PetsSearchBar.kt
index 8e23ede..1c1e391 100644
--- a/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/ui/components/PetsSearchBar.kt
+++ b/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/ui/components/PetsSearchBar.kt
@@ -11,7 +11,6 @@ import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.icons.Icons
-import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material.icons.filled.AccountCircle
import androidx.compose.material.icons.filled.Search
import androidx.compose.material3.DockedSearchBar
@@ -30,6 +29,7 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.unit.dp
import com.multiplatformkickstarter.app.localization.Localization
+import com.multiplatformkickstarter.app.ui.icon.MultiplatformKickstarterIcons
@Composable
fun PetsSearchBar(
@@ -75,7 +75,7 @@ fun PetsSearchBar(
leadingIcon = {
if (active) {
Icon(
- imageVector = Icons.AutoMirrored.Filled.ArrowBack,
+ imageVector = MultiplatformKickstarterIcons.ArrowBack,
contentDescription = localization.backButton,
modifier = Modifier
.padding(start = 16.dp, end = 8.dp)
diff --git a/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/ui/icon/MultiplatformKickstarterIcons.kt b/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/ui/icon/MultiplatformKickstarterIcons.kt
index 5aa8564..8f21c1d 100644
--- a/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/ui/icon/MultiplatformKickstarterIcons.kt
+++ b/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/ui/icon/MultiplatformKickstarterIcons.kt
@@ -9,6 +9,7 @@ import androidx.compose.material.icons.automirrored.rounded.TextSnippet
import androidx.compose.material.icons.rounded.ArrowDropDown
import androidx.compose.material.icons.rounded.BrokenImage
import androidx.compose.material.icons.rounded.Check
+import androidx.compose.material.icons.rounded.Close
import androidx.compose.material.icons.rounded.Create
import androidx.compose.material.icons.rounded.Delete
import androidx.compose.material.icons.rounded.Email
@@ -51,6 +52,7 @@ object MultiplatformKickstarterIcons {
val Help = Icons.AutoMirrored.Rounded.Help
val Pets = Icons.Rounded.Pets
val BrokenImage = Icons.Rounded.BrokenImage
+ val Close = Icons.Rounded.Close
}
/**
diff --git a/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/ui/screens/HomeTabScreen.kt b/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/ui/screens/HomeTabScreen.kt
index 2b663f1..09c87a8 100644
--- a/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/ui/screens/HomeTabScreen.kt
+++ b/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/ui/screens/HomeTabScreen.kt
@@ -35,6 +35,7 @@ import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBar
import androidx.compose.runtime.Composable
+import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
@@ -43,9 +44,8 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
-import cafe.adriel.voyager.core.lifecycle.LifecycleEffect
import cafe.adriel.voyager.core.screen.Screen
-import cafe.adriel.voyager.koin.getScreenModel
+import cafe.adriel.voyager.koin.koinScreenModel
import cafe.adriel.voyager.navigator.LocalNavigator
import cafe.adriel.voyager.navigator.currentOrThrow
import com.multiplatformkickstarter.app.common.model.PetCategory
@@ -70,15 +70,14 @@ class HomeTabScreen : Screen {
@Composable
override fun Content() {
val navigator = LocalNavigator.currentOrThrow
- val viewModel = getScreenModel(
+ val viewModel = koinScreenModel(
parameters = { ParametersHolder(listOf(navigator).toMutableList(), false) }
)
- LifecycleEffect(
- onStarted = {
- viewModel.onStarted(navigator)
- }
- )
+ DisposableEffect(key) {
+ viewModel.onStarted(navigator)
+ onDispose {}
+ }
HomeScreenView(viewModel)
}
diff --git a/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/ui/screens/ProfileTabScreen.kt b/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/ui/screens/ProfileTabScreen.kt
index 5043e23..32abf9f 100644
--- a/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/ui/screens/ProfileTabScreen.kt
+++ b/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/ui/screens/ProfileTabScreen.kt
@@ -18,15 +18,15 @@ import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
+import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.unit.dp
-import cafe.adriel.voyager.core.lifecycle.LifecycleEffect
import cafe.adriel.voyager.core.screen.Screen
-import cafe.adriel.voyager.koin.getScreenModel
+import cafe.adriel.voyager.koin.koinScreenModel
import cafe.adriel.voyager.navigator.LocalNavigator
import cafe.adriel.voyager.navigator.currentOrThrow
import com.multiplatformkickstarter.app.localization.Localization
@@ -52,15 +52,14 @@ class ProfileTabScreen : Screen {
val navigator = LocalNavigator.currentOrThrow
val localization = getCurrentLocalization()
- val viewModel = getScreenModel(
+ val viewModel = koinScreenModel(
parameters = { ParametersHolder(listOf(navigator).toMutableList(), false) }
)
- LifecycleEffect(
- onStarted = {
- viewModel.onStarted(navigator)
- }
- )
+ DisposableEffect(key) {
+ viewModel.onStarted(navigator)
+ onDispose {}
+ }
val state by viewModel.state.collectAsState()
if (state.isLoggedIn) {
diff --git a/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/ui/screens/SearchListingScreen.kt b/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/ui/screens/SearchListingScreen.kt
index 2e872e6..f85b643 100644
--- a/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/ui/screens/SearchListingScreen.kt
+++ b/shared/src/commonMain/kotlin/com/multiplatformkickstarter/app/ui/screens/SearchListingScreen.kt
@@ -10,7 +10,6 @@ import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowBack
-import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
@@ -21,15 +20,15 @@ import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBar
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.runtime.Composable
+import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
-import cafe.adriel.voyager.core.lifecycle.LifecycleEffect
import cafe.adriel.voyager.core.screen.Screen
-import cafe.adriel.voyager.koin.getScreenModel
+import cafe.adriel.voyager.koin.koinScreenModel
import cafe.adriel.voyager.navigator.LocalNavigator
import cafe.adriel.voyager.navigator.currentOrThrow
import com.multiplatformkickstarter.app.common.model.PetCategory
@@ -57,15 +56,14 @@ class SearchListingScreen(
val snackbarHostState = remember { SnackbarHostState() }
val navigator = LocalNavigator.currentOrThrow
- val viewModel = getScreenModel(
+ val viewModel = koinScreenModel(
parameters = { ParametersHolder(listOf(searchId, petCategory, navigator).toMutableList(), false) }
)
- LifecycleEffect(
- onStarted = {
- viewModel.onStarted()
- }
- )
+ DisposableEffect(key) {
+ viewModel.onStarted()
+ onDispose {}
+ }
SetupSideEffects(viewModel, snackbarHostState, localization)
MultiplatformKickstarterTheme {