Flutter 回到指定页面 常规需求,页面A-B-C,C进入D,此时有回到首页功能,我们就需要结束B、C、D 1.在首页注册路由 MaterialApp( home: const LoginPage(), routes: { "/homePage": (context) => const HomePage(), }, ) 2.在页面 D 调用 Navigator.popUntil(context, ModalRoute.withName("/homePage"));