【填坑】 Navigator operation requested with a context that does not include a Navigator.

在MaterialApp中会导致Navigator 报错

1.使用main 进行转移

return MaterialApp(

  title: 'xxxx',
debugShowCheckedModeBanner: false, //去掉页面右上角的debug标识
theme: ThemeData(
primarySwatch: Colors.blue,
),
home:LoginScreen(),
);
2.在LoginScreen中使用Navigator 

猜你喜欢

转载自www.cnblogs.com/Locog/p/12699352.html
今日推荐