navigationStackFrom method
Modifies the navigation stack based on the current stack and the new navigation type.
Implementation
@override
List<ViewNavigationType> navigationStackFrom(
List<ViewNavigationType> currentStack,
) {
final targetIndex = currentStack.lastIndexWhere(
(page) => page.screenName == screenName,
);
if (targetIndex == -1) {
return currentStack;
}
return currentStack.sublist(0, targetIndex + 1);
}