【问题标题】:Blank screen appears on chrome when I run(F5) the Flutter web app (I use VScode)当我运行(F5)Flutter Web 应用程序(我使用 VScode)时,chrome 上出现空白屏幕
【发布时间】:2020-11-16 10:03:42
【问题描述】:

我正在使用 VScode (F5) 在 chrome 上运行 Flutter Web 应用程序,它会打开一个新选项卡,其标题与项目名称相同,但屏幕为空白。在调试控制台中,它显示Launching lib\main.dart on chrome in debug mode... 并且不显示任何其他内容。我尝试了命令flutter run -d web 并且运行良好。如果我在 vscode 中运行或按 F5,如何使其工作? VScode Image Chrome image

【问题讨论】:

  • 试试flutter run -d --release
  • 你能在这里添加你的代码吗?以及您在终端中遇到的错误
  • @NileshSenta 对我不起作用
  • @Alok 我试过“颤振创建”。但还是没用

标签: flutter visual-studio-code flutter-web


【解决方案1】:

我也遇到了这个问题,通过禁用 chrome 中的硬件加速解决了这个问题。

【讨论】:

    【解决方案2】:

    在终端中,尝试flutter upgrade

    然后flutter run -v

    flutter 会发生这种情况,有时构建一个应用程序需要很长时间

    【讨论】:

      【解决方案3】:

      尝试在终端中运行:

      • 颤振通道开发
      • 颤振升级
      • flutter run -d chrome

      如果它仍然显示一个空白页面,则终止当前服务器 'ctrl + c'。

      然后运行

      flutter 运行 -d 网络

      终端将为您提供一个新的 localhost URL。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2020-03-05
        • 1970-01-01
        • 1970-01-01
        • 2021-01-29
        • 1970-01-01
        • 2021-09-03
        • 1970-01-01
        相关资源
        最近更新 更多