package Ġcom . space apps . my application . utils Ċ Ċ import Ġandroidx . navigation . Nav Host Controller Ċ import Ġdagger . h ilt . android . scopes . Activity Ret ained Scoped Ċ import Ġkotlinx . coroutines . Coroutine Scope Ċ import Ġkotlinx . coroutines . channels . Channel . Factory . UN LIMIT ED Ċ import Ġkotlinx . coroutines . flow . Mutable Shared Flow Ċ import Ġkotlinx . coroutines . flow . as Shared Flow Ċ import Ġkotlinx . coroutines . launch Ċ import Ġjavax . inject . Inject Ċ import Ġkotlin . coroutines . Empty Coroutine Context Ċ Ċ type alias ĠNavigation Command Ġ= Ġ( Nav Host Controller ) Ġ-> ĠUnit Ċ Ċ @ Activity Ret ained Scoped Ċ class ĠNavigation Dispatcher Ġ@ Inject Ġconstructor () Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġcoroutine Scope Ġ= ĠCor outine Scope ( Empty Coroutine Context ) ĊĠĠĠ Ġprivate Ġval Ġ_ emitter Ġ= ĠMutable Shared Flow < Navigation Command >( extra Buffer Capacity Ġ= ĠUN LIMIT ED ) ĊĠĠĠ Ġval Ġemitter Ġget () Ġ= Ġ_ emitter . as Shared Flow () ĊĊĠĠĠ Ġfun Ġemit ( command : ĠNavigation Command ) Ġ= Ġcoroutine Scope . launch Ġ{ Ġ_ emitter . emit ( command ) Ġ} Ċ } Ċ