add the given route to the end of the stack.
if the given route is already present further up the stack,
then the stack is trimmed to that position instead.
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
pop the given route, and all routes after it, from the stack.
if no route is provided, then the last route is popped.
if the given route is not in the stack, then no changes are made.
put the given route into the stack as the last route,
replacing the route currently in that position.
if the given route is already present further up the stack,
then the stack is trimmed to that position instead.
Note that this operation does not increase the stack depth.