Is there a way to grab the NavController like a singleton? I have an async api call that I want to switch screens if returned ok. Right now I have to physically pass the nav controller into the async cb and it would be alot cleaner if I could call it back as a singleton when ever I needed it in my code.
a
Abhishek Dewan
08/08/2021, 1:14 AM
Passing nav controller isn't the recommended way since it makes your code difficult to test. Passing lambdas is easier to test