有没有办法在宣布该河中的国家提供商的价值
final itemCountProvider = StateProvider<int>((ref) {
return 0;
});
我需要跟踪项目中选择的项目数量最初是零,但是后来我需要给它一个计算的值,如何更新ItemCountProvider中的值,因为它已经被声明为最终
final itemCountProvider = StateProvider<int>((ref) {
return 0;
});
i need to keep track of number of items selected in my project initially the item count would be zero but later on i need to give it the calculated value how to update the value in itemCountProvider as it is already declared final
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以这样更新州提供商的价值:
这是一个示例计数器应用程序:
You can update the value of state provider like so:
Here is an example counter app:
或或或或或
或或或
或或
You can update the state with
read
or
or