颤振冻结 + Bloc-如何两次发出相同的状态并重建 UI
我有一个关于 Freezed+Bloc 包的问题
有谁知道如何两次发出相同的状态,但让 Bloc 知道他必须重建 UI?
我无法
*我知道我可以使用 Equatable 实现这一目标,但我不太明白如何在使用 Freezed 时实现它
I have a question regarding Freezed+Bloc package
Does anyone know how to emit the same state twice but making Bloc knows he has to rebuild UI?
I'm not being able to
*I know I would be able to achieve this using Equatable, but I don't quite understand how to implement it while using Freezed
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果这仍然与任何人相关,那么这里是问题的解决方案。
您需要在注释中指定 equal: false。
问题在于 Freezed 扩展了 Equitable,但如果状态相同,则 Bloc 不会改变状态。
If this is still relevant to anyone, here is the solution to the problem.
You need to specify equal: false in the annotation.
The problem is that Freezed extends Equitable, but the Bloc does not change states if they are identical.