Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是新手,在我的一个项目页面中颤抖,无论我做什么,设置状态都根本不起作用我尝试了几乎所有的东西,每次都不起作用,所以什么认为可以阻止设置状态工作?注意:我正在使用提供者和共享偏好
实际上,没有什么能阻止它工作,因为你是新手,我邀请你接受 Flutter 没有问题,而是你的 Flutter 技能有问题。如果您提供一些代码,我们可能会提供帮助
setState(){}只在StatefulWidget课堂上工作,我想你正在使用StatelessWidget. 如果您想使用它,请将您的课程更改为StatefulWidget.
setState(){}
StatefulWidget
StatelessWidget