【flutter报错】Cannot invoke a non-'const' constructor where a const expression is expected. Try using a constructor or factory that is 'const'.

参考来自
这段话解决了问题
Unfortunately not all widgets has a const constructor, Container and Column are two examples of that. You won't be able to construct those widgets as child of a const constructor.

出现这个报错的时候可以看看是否在附近使用了const 去掉就好了

posted @ 2024-07-13 23:11  ayubene  阅读(26)  评论(0编辑  收藏  举报