Replaces the top-most Page in the stack with the given page.
page
void replace(Page page) { emit( [ ...state.take(state.length - 1), page, ], ); }