Closed ursusursus closed 1 year ago
Thanks for your suggestion!
It's just a list, so as long as you're not calling this in a loop a lot, this won't cause any measurable performance / memory impact. And usually this will not happen as calls to the backstack normally happen in reaction to a user event.
Hey, I find my self peeking at the top of backstack often.
getBackstack().lastOrNull()?.controller
This however allocates the list unnecessarily
I used to be able to "hack" it by creating same package but now as
Backstack
moved to kotlin and it's internal, this no longer works (this.backstack.peek()?.controller
)It would complement the
getBackstackSize
well