flutter 使用 iOS 模拟器,保存代码不可以热重载?

解决方案一:

查看控制台终端,因为我们应该已经运行了 flutter run 命令,这时候会看到有一些提示,显示不同快捷键不同的功能:
  • Flutter run key commands.
  • r Hot reload. 🔥🔥🔥
  • R Hot restart.
  • h List all available interactive commands.
  • d Detach (terminate "flutter run" but leave application running).
  • c Clear the screen
  • q Quit (terminate the application on the device).

这时候在控制台终端按一下 r 会直接重载模拟器页面;

解决方案二:

点击 vscode左侧,运行与调试,将代码运行起来,选择当前项目,这样代码修改,模拟器中的页面就可以是实时更新。

posted @ 2024-03-07 13:57  蓓蕾心晴  阅读(67)  评论(0编辑  收藏  举报