You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reasoning is that destinations need args to render properly, always. NavAction's role is to simply deliver them to the new destination.
Once arguments become part of destination, it will be possible to do something like this:
// could be serialized using Gsondata classDetailScreenArgs(
@SerializedName("itemId")
valitemId:Int
)
object MyGraph : NavGraph("myGraph") {
valList= navDestination("list") { ListScreen() }
valDetail=List.nextWithArgs<DetailScreenArgs> {
param("itemId")
} { args ->DetailScreen(args) }
}
This way destination would declare both, the type of the used args and how it renders in one place. This could potentially make it possible to automatically build a graph with NavGraphBuilder. NavGraph methods like navDestination could remember created destiantions. This will simplify the graphs definition by a lot
Also, args should be part of the information about back stack. Currently, there is no real way to tell apart 2 instances of the same destination, even if they are launched with different set of arguments.
Potential issues:
How should the destination like the one below work:
Reasoning is that destinations need args to render properly, always. NavAction's role is to simply deliver them to the new destination.
Once arguments become part of destination, it will be possible to do something like this:
This way destination would declare both, the type of the used args and how it renders in one place. This could potentially make it possible to automatically build a graph with NavGraphBuilder.
NavGraph
methods likenavDestination
could remember created destiantions. This will simplify the graphs definition by a lotAlso, args should be part of the information about back stack. Currently, there is no real way to tell apart 2 instances of the same destination, even if they are launched with different set of arguments.
Potential issues:
The text was updated successfully, but these errors were encountered: