goToTarget method
非页面跳转,只切换到目标页面 (例如主页的Tab切换)
Implementation
void goToTarget(Widget page, {bool insert = true}) {
_navigateToTargetCallBack?.call(navigatorKey.currentContext!, page);
if (insert) {
// 避免重复添加
if (_targetPageQueue.isNotEmpty &&
_targetPageQueue.last.runtimeType == page.runtimeType) return;
_targetPageQueue.add(page);
}
if (_targetPageQueue.length > _maxQueue) {
_targetPageQueue.removeAt(0);
}
}