Kyle
08/13/2023, 10:14 PMAndrei Kovalev
08/14/2023, 9:15 AMBackStack
Zsolt
08/14/2023, 9:58 AMParentNode
in that graph has their own AppyxComponent
(it can be BackStack
or another component too).
We could pretend that whenever the tree animation changes, it’s because of the local BackStack
in one of the `ParentNode`s is doing some operation (push, pop, etc.).
There’s no global one. So in this specific image, there would be a total of 4 individual BackStack
instances, one for each of: Root, Onboarding, Main, Messages, and each of them only sees their direct children as possible local navigation targets:
• Onboarding for example can only decide to push/pop related to the *O1*/*2*/*3* onboarding screens.
• Root can only decide to switch between Onboarding and Main.
But while they’re local pieces, if you chain them together you get a global navigation emerging from them as illustrated on the gif.Kyle
08/14/2023, 2:09 PMZsolt
08/14/2023, 2:13 PMKyle
08/14/2023, 2:25 PMKyle
08/14/2023, 2:28 PMZsolt
08/14/2023, 2:30 PMonGoToSettings: () -> Unit
which would be implemented by AuthenticatedNode
such as: { backStack.push(Settings) }
.
2. You could go with the Navigator approach explained in the Explicit navigation page.
The back stack that pushes Settings will also keep the previous back stack entry alive without its view – and that previous entry has its subtree still attached to it. So when you pop Settings, you’ll find yourself where you were before.