notifyListeners()实际上是如何工作的?
因此,我有这个类,并使用方法 addItem 将一些项目添加到我的购物车和 itemsCount 以使我的总项目显示在 AppBar 的购物车图标中。
我的问题是,如果 itemsCount 没有,那么在我使用 addItem 后 itemsCount 如何更新 通知监听器()?
addItem 中的notifyListeners() 会更新它吗? notifyListeners() 实际上更新了所有应用程序中正在使用的类中的所有方法?
So, I have this class and I use the method addItem to add some item to my cart and itemsCount to have my total items show up in my cart icon in AppBar.
My question is, how the itemsCount is update after I use addItem if itemsCount does not have
notifyListeners( )?
The notifyListeners( ) in addItem that update that? The notifyListeners( ) actually update all the methods in class that are being using in all the app?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论