Hazem
Hazem

Reputation: 41

How to make navigation works inside a sheet without having two Navcontrollers and hosts

I have an app with regular screens and then it shows a sheet, and the sheet can open multiple screen in it How can I do this inside a single navhost?

The only way I was able to do it while obviously keeping the same slide animation inside the sheet or the pop up is to define two navcontrollers and navhosts, one for the main activity and the second one inside the Mainsheet and all the screens inside the sheet

Upvotes: 3

Views: 148

Answers (1)

ianhanniballake
ianhanniballake

Reputation: 200080

is to define two navcontrollers and navhosts, one for the main activity and the second one inside the Mainsheet and all the screens inside the sheet

This is exactly what you should be doing if you want a back stack to exist within a single bottom sheet. A NavHost is just a box for your content to be in so it makes sense to have a content outside your sheet and separate content within your sheet.

Upvotes: 2

Related Questions