Skip to content

Commit 7fbab5e

Browse files
Allow metadata parameter passing to the entry point (like animtations and others). Upgrade Nav3 to stable 1.0.0
1 parent e236731 commit 7fbab5e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

projects/compose/koin-compose-navigation3/src/commonMain/kotlin/org/koin/dsl/navigation3/ModuleExt.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import org.koin.dsl.ScopeDSL
4646
* ```
4747
*
4848
* @param T The type representing the navigation route/destination
49+
* @param metadata Optional metadata map to associate with the navigation entry (default is empty)
4950
* @param definition A composable function that receives the [Scope] and route instance [T] to render the destination
5051
* @return A [KoinDefinition] for the created [EntryProviderInstaller]
5152
*
@@ -55,12 +56,13 @@ import org.koin.dsl.ScopeDSL
5556
@KoinDslMarker
5657
@OptIn(KoinInternalApi::class)
5758
inline fun <reified T : Any> ScopeDSL.navigation(
59+
metadata: Map<String, Any> = emptyMap(),
5860
noinline definition: @Composable Scope.(T) -> Unit,
5961
): KoinDefinition<EntryProviderInstaller> {
6062
val def = _scopedInstanceFactory<EntryProviderInstaller>(named<T>(), {
6163
val scope = this
6264
{
63-
entry<T>(content = { t -> definition(scope, t) })
65+
entry<T>(content = { t -> definition(scope, t) }, metadata = metadata)
6466
}
6567
}, scopeQualifier)
6668
module.indexPrimaryType(def)
@@ -85,6 +87,7 @@ inline fun <reified T : Any> ScopeDSL.navigation(
8587
* ```
8688
*
8789
* @param T The type representing the navigation route/destination
90+
* @param metadata Optional metadata map to associate with the navigation entry (default is empty)
8891
* @param definition A composable function that receives the [Scope] and route instance [T] to render the destination
8992
* @return A [KoinDefinition] for the created [EntryProviderInstaller]
9093
*
@@ -94,12 +97,13 @@ inline fun <reified T : Any> ScopeDSL.navigation(
9497
@KoinDslMarker
9598
@OptIn(KoinInternalApi::class)
9699
inline fun <reified T : Any> Module.navigation(
100+
metadata: Map<String, Any> = emptyMap(),
97101
noinline definition: @Composable Scope.(T) -> Unit,
98102
): KoinDefinition<EntryProviderInstaller> {
99103
val def = _singleInstanceFactory<EntryProviderInstaller>(named<T>(), {
100104
val scope = this
101105
{
102-
entry<T>(content = { t -> definition(scope, t) })
106+
entry<T>(content = { t -> definition(scope, t) }, metadata = metadata)
103107
}
104108
})
105109
indexPrimaryType(def)

projects/gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jb-lifecycle = "2.9.5"
2626

2727
# Navigation
2828
androidx-navigation = "2.9.5" # Keep in sync with "jb-navigation"
29-
androidx-navigation3 = "1.0.0-beta01"
29+
androidx-navigation3 = "1.0.0"
3030
jb-navigation = "2.9.1"
3131

3232
# Compose

0 commit comments

Comments
 (0)