package Ġjp . t aku ji 3 1 . compose . navigation . screen Ċ Ċ import Ġandroidx . compose . runtime . Composable Ċ import Ġandroidx . compose . runtime . remember Ċ import Ġandroidx . navigation . Nav Host Controller Ċ import Ġandroidx . navigation . Nav Options Builder Ċ import Ġandroidx . navigation . compose . remember Nav Controller Ċ import Ġkotlinx . coroutines . flow . Mutable State Flow Ċ import Ġkotlinx . coroutines . flow . State Flow Ċ Ċ class ĠScreen Nav Controller ( val Ġnav Controller : ĠNav Host Controller ) Ġ{ ĊĠĠĠ Ġprivate Ġval Ġ_ current Screen Ġ= ĠMutable State Flow < Screen < Enum <* >> ? >( null ) ĊĠĠĠ Ġval Ġcurrent Screen : ĠState Flow < Screen < Enum <* >> ?> ĊĠĠĠĠĠĠĠ Ġget () Ġ= Ġ_ current Screen ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ Ġnav Controller . add On Destination Changed Listener Ġ{ Ġ_, Ġdestination , Ġargs Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġroute Ġ= Ġdestination . route Ġ?: Ġreturn @ add On Destination Changed Listener ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ_ current Screen . value Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠScreen Factory Registry . findBy Route < Screen Factory < *> >( route ). from Bundle ( args ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġnavigate ( screen : ĠScreen < Enum <* >>, Ġbuilder : ĠNav Options Builder . () Ġ-> ĠUnit Ġ= Ġ{}) Ġ{ ĊĠĠĠĠĠĠĠ Ġnav Controller . navigate ( screen . parameter ized Route , Ġbuilder ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġpop Back Stack () Ġ{ ĊĠĠĠĠĠĠĠ Ġnav Controller . pop Back Stack () ĊĠĠĠ Ġ} Ċ } Ċ Ċ @ Composable Ċ fun Ġremember Screen Nav Controller (): ĠScreen Nav Controller Ġ{ ĊĠĠĠ Ġval Ġnav Controller Ġ= Ġremember Nav Controller () ĊĠĠĠ Ġreturn Ġremember ( nav Controller ) Ġ{ ĊĠĠĠĠĠĠĠ ĠScreen Nav Controller ( nav Controller ) ĊĠĠĠ Ġ} Ċ } Ċ