replaceLastWith method
Implementation
void replaceLastWith(BuildContext context, AppPageNode<T> page) {
final navState = context.findAncestorStateOfType<NavigatorState>();
final key = navState?.widget.key ?? rootNavKey;
_rootPageNodesSetter = _handleStackAction(
(currentStack) => currentStack.replaceLastWith(page),
key,
);
notifyListeners();
}