Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to operate with NavEntry in the 'navigate' 'replace' edit-backstack #74

Open
vkatz opened this issue Oct 10, 2024 · 3 comments

Comments

@vkatz
Copy link
Contributor

vkatz commented Oct 10, 2024

EG:

val t = SomeScreen.toNavEntry(freeArgs=1)
navController.navigate(t)
@vkatz vkatz changed the title Add option to operate with NavEtry in the 'naigate' 'replace' edit-backstack Add option to operate with NavEtry in the 'navigate' 'replace' edit-backstack Oct 10, 2024
@egorikftp egorikftp changed the title Add option to operate with NavEtry in the 'navigate' 'replace' edit-backstack Add option to operate with NavEntry in the 'navigate' 'replace' edit-backstack Oct 10, 2024
@vkatz
Copy link
Contributor Author

vkatz commented Oct 15, 2024

Pros - easy to navigate to NavEntry
Cons - some one can try smth like nc.navigate(nc.currentNavEntry) ...

Need to add some fool-protection...
Simple solution - add flag attached to NavEntry... make attached after being displayed in any nc, throw errot if some one tryes to navigate with attached entry

@vkatz
Copy link
Contributor Author

vkatz commented Oct 15, 2024

soulution 2 create a separeta class eg: PendingNavEntry and allow to use it in navigation
Sounds more protective (even tho you can try to create new PendingNavEntry from existing entry - you will not be able to broke anything, it will be just new instance of entry)

@vkatz
Copy link
Contributor Author

vkatz commented Oct 15, 2024

solution 3 - whenewer some one tryes to navigate/ add to backstack with NavEntry - create a copy (dest + args) and use it
<- wining for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant