replaceLastWith method

void replaceLastWith(
  1. BuildContext context,
  2. AppPageNode<T> page
)

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();
}