【问题标题】:Error 404 page not found /profileScreen in flutter颤振中找不到错误404页面/profileScreen
【发布时间】:2020-10-11 06:04:35
【问题描述】:

我正在使用颤振 auto_route 包进行导航。当我在上下文中导航屏幕时会发生此错误。例如: 如果我写

 ExtendedNavigator.named('BuyRouter').push(HomeRoutes.profileScreen);

这在 BuyRouter 屏幕上有效并推送,但我遇到的问题是我想在上下文中推送屏幕。 当我将其应用于上下文时。

  ExtendedNavigator.root.push(HomeRoutes.profileScreen);

出现错误 404 页面/配置文件屏幕。

【问题讨论】:

    标签: flutter dart navigation navigation-drawer autorotate


    【解决方案1】:
    ExtendedNavigator.of(context).push(HomeRoutes.profileScreen)
    

    解决了问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-07-04
      • 2012-12-29
      • 2013-12-04
      • 2016-12-06
      • 1970-01-01
      • 1970-01-01
      • 2019-01-01
      相关资源
      最近更新 更多