//到指定页面
void backTo(String pageName) {
Navigator.of(context).popUntil((route) => route.settings.name == pageName);
}
//到根
void get backToRoot => Navigator.of(context).popUntil((route) => route.isFirst);
//到指定页面
void backTo(String pageName) {
Navigator.of(context).popUntil((route) => route.settings.name == pageName);
}
//到根
void get backToRoot => Navigator.of(context).popUntil((route) => route.isFirst);
本文标题:flutter pop到指定页面和根页面
本文链接:https://www.haomeiwen.com/subject/ssiqjktx.html
网友评论