when should we use NavigableListDetailPaneScaffold...
# compose
p
when should we use NavigableListDetailPaneScaffold and when ListDetailPaneScaffold? both appears to be more or less the same, and I'm not sure what should we use. In theory, the first adds navigation, but I see that the second also uses it, so don't see the benefits or real differences
a
NavigableListDetailPaneScaffold
is part of the layered
adaptive-navigation
artifact, which indeed adds some basic navigation functionality with the
navigator
APIs. The plain
ListDetailPaneScaffold
is part of a different layered
adaptive-layout
artifact, which expects something else to handle keeping the navigation-like state of the list and detail setup. The main idea is that if you want an out-of-the-box navigator that is compatible with the list-detail setup, import the
adaptive-navigation
artifact, and then use the navigator APIs. If you want to control the navigation yourself, then you can avoid importing
adaptive-navigation
at all, and then manually specify to the
ListDetailPaneScaffold
the state for what to show
👍 1
This blog goes into a bit more detail about the layering setup