VSCode hot reload for Flutter does not work

后端 未结 14 1303
野性不改
野性不改 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: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.

提交回复
热议问题