Flutter 使用动态参数导航颤振应用程序

Flutter 使用动态参数导航颤振应用程序,flutter,webview,navigation-drawer,Flutter,Webview,Navigation Drawer,我正在尝试从我的主页路由到webview页面。如果我按下任何按钮,它都可以正常工作。但如果我点击抽屉菜单项,它只会显示错误,而不是显示该页面。错误: setState() or markNeedsBuild() called during build. This Overlay widget cannot be marked as needing to build because the framework is already in the process of building widget

我正在尝试从我的主页路由到webview页面。如果我按下任何按钮,它都可以正常工作。但如果我点击抽屉菜单项,它只会显示错误,而不是显示该页面。错误:

setState() or markNeedsBuild() called during build.
This Overlay widget cannot be marked as needing to build because the framework is already in the process of building widgets.
从抽屉菜单调用my webview单击:

Navigator.pushNamed(context, '/details',
        arguments: ScreenArguments(
          'Pay Now',
          "https://www.test.com/"+_customerID,
        ));

你能告诉我这里的主要问题在哪里以及如何解决吗。提前谢谢

不。。。我正在使用“onPressed”事件添加onPressed属性的代码。。。我正在使用onTap事件
new listile(contentPadding:EdgeInsets.only(left:50.0),前导:new Icon(Icons.web),标题:new Text(“立即付款”),selected:3==\u selectedDrawerIndex,onTap:()=>Navigator.pushNamed(上下文,“/details”,参数:ScreenArguments(‘立即付款’,”https://www.test.com/“+_customerID,);,
您的代码中是否使用了setState?是的..我正在我的主页中使用setState(),我的抽屉菜单所在的位置