关于'!_debugLocked': is not true.问题

可以使用Future去包含路由跳转:

  Future.delayed(Duration.zero,(){
    Navigator.of(context).push(MaterialPageRoute(
      builder: (BuildContext context) => routes.buildPage(path, params),
    ));
  });
  Future.delayed(Duration.zero,(){
    Navigator.of(context).push(MaterialPageRoute(
      settings: RouteSettings(name: path),
      builder: (BuildContext context) => routes.buildPage(path, params),
      fullscreenDialog: true,
    ));
  });
  Future.delayed(Duration.zero,(){
    Navigator.of(context).pop();
  });

你可能感兴趣的:(关于'!_debugLocked': is not true.问题)