navigatorKey 已经添加到代码中,但在 navigatorKey 下仍然显示错误(红线)。
@override
Widget build(BuildContext context) {
return WillPopScope(
navigatorKey: _alice.getNavigatorKey(),
child: Theme(
data: ThemeData(
brightness: Brightness.light,
primarySwatch: AppColor.appColor,
primaryColor: AppColor.white,
buttonTheme: ButtonThemeData().copyWith(
buttonColor: AppColor.appColor,
textTheme: ButtonTextTheme.primary),
fontFamily: "EncodeSans",
),
child: layout()),
onWillPop: () {
return handleBackPress();
});
}