Open terrakok opened 1 year ago
See uniqueScreenKey from https://voyager.adriel.cafe/state-restoration#identifying-screens
Thank you. I know the uniqueScreenKey
function. I said about default behavior
It can't be default beavior since Screen
is an interface, and interfaces cannot have backing fields. I believe the AndroidScreen from the androidx module uses uniqueScreenKey
by default since its an abstract class. You could use a similar solution if you don't use the AndroidScreen
Oh! I see :) we cannot save value here
but, anyway, default behavior is quite confusing because it hides the problem. maybe lack of default key would be better
At the moment default screen key is
this::class.qualifiedName
. It leads to a behavior when new screen restores a previous state because it was saved in the past.A typical scenario is:
Login screen
-[replace]->Main screen
-[replace]->Login Screen
Last
Login screen
will restore state from the first launch because it depends on its key.Better solution is to generate random key for each usage