VSCode hot reload for Flutter does not work

后端 未结 14 1171
野性不改
野性不改 2021-01-11 11:50

I\'m on VSCode right now working on my flutter application when hot reload just stops working, right in the middle of my development. I have absolutely no idea why this happ

相关标签:
14条回答
  • 2021-01-11 12:38

    For those who are using MAC.

    I am using mac, and I handled this through by quitting first the emulator and VS Code and then restarting the computer.

    It should be kept in mind that when you use stateless or stateful widget then you can get the feature of hot reload.

    By pressing command+s it will save the file and will perform hot reload automatically.

    0 讨论(0)
  • 2021-01-11 12:40

    I had the same problem in VS code. Here is how I solved it :

    1. I was using style property for Text from an external file. I found that change in external file doesn't reflect in hot reload.

                Text(
                  AppStrings.giveFeedbackPageText,
                  style: AppStyles.bodyText,
                  textAlign: TextAlign.center,
                  overflow: TextOverflow.ellipsis,
                ),
      

      So I had to use TextStyle from that file instead of an external file, and it works! Dont know the reason. Probably the external style needs to be inside a widget.

    2. Another solution could be - separating home from MaterialApp into a separate widget.

    0 讨论(0)
提交回复
热议问题