popUntil<T extends Object> method
pop until a page, find the first match target, if not find in this navigator,
find in native, this way will remove all un match VC and route
eg: N1(/main) F1(/home) F1(/first) popUntil(/main) will remove /home /first and VC(F1)
Implementation
void popUntil<T extends Object>(String target, [T? result]) {
///find in current routes, remove top
if (foundInCurrentRoutes(target)) {
bool findTarget = false;
while (!findTarget) {
if (_history.isNotEmpty) {
RouteConfig temp = _history.last;
if (temp.path == target) {
findTarget = true;
callbacks![temp]!.complete(result);
} else {
_history.removeLast();
_pages.removeLast();
}
} else {
findTarget = true;
}
}
notifyListeners();
} else {
print('not find ${target} in Uris');
}
/// multiply flutters should chat with native
NavigatorChannel.popUntil(target, result);
}