builder: (BuildContext context) => const MyHomePage(), ), (route) => false // ModalRoute.withName('/') ); 也可以直接使用路由名稱進行上面操作,例如跳轉(zhuǎn):Navigator.pushNamed(context, '/home');路由名稱需要提前在MaterialApp中定義好。 1 2 3 4 5 6 7 8 MaterialApp( title: 'Flutter Demo',...
www.dbjr.com.cn/article/2659...htm 2025-6-7