@@ -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 )
5758inline 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 )
9699inline 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)
0 commit comments