https://kotlinlang.org logo
#compose
Title
# compose
j

John O'Reilly

11/19/2020, 6:45 PM
In @Manuel Vivo talk just now at "Kotlin Meetup Munich" he showed following but I can't resolve
AmbientNavController
for some reason....am using alpha02 of
navigation-compose
. Should this be available?
i

Ian Lake

11/19/2020, 6:47 PM
It was removed prior to the alpha01
As it led to tight coupling of components into Navigation, rather than being separately testable ala our testing guide: https://developer.android.com/jetpack/compose/navigation#testing
j

John O'Reilly

11/19/2020, 6:49 PM
Is there something in it's place or is expectation that you pass
navController
down? Main reason I need it right now is to call
navController.popBackStack()
for back button
m

Manuel Vivo

11/19/2020, 6:50 PM
Ah! Sorry, the slides aren’t fully updated to the last version 🙈 my bad
Should’ve checked before giving the talk
the expectation is to pass it down to whenever it’s needed
makes testing easier as well
j

John O'Reilly

11/19/2020, 6:51 PM
I had it in a pre-alpha version and had taken it out all right (in favor of passing it down) after updating to alpha version.....but thought maybe I had mistakenly thought it was removed 🙂
i

Ian Lake

11/19/2020, 6:51 PM
As per the testing page linked above, pass a
popBack: () -> Unit
lambda down
👍 1