简体   繁体   English

Cubit 和 Equatable 有什么区别?

[英]What is the difference between Cubit and Equatable?

Why we should use cubit ?为什么我们应该使用 cubit ?

When to use Equatable ?何时使用 Equatable ?

what is the diffrence between Cubit and Equatable ? CubitEquatable 有什么区别?

Can anyone help me ?谁能帮我 ?

Cubit method-based state is a structure that you can update, while bloc works entirely with streams. Cubit 基于方法的状态是一种可以更新的结构,而 bloc 完全适用于流。 You should also send an event(async) to update the state in Bloc.您还应该发送一个事件(异步)来更新 Bloc 中的状态。

The Equatable library, on the other hand, is used to ensure that your screen is not refreshed again if the state is the same as the previous state when updated.另一方面,Equatable 库用于确保如果状态与更新时的先前状态相同,则不会再次刷新屏幕。 There is an increase in performance because the screen is not refreshed again and again unnecessarily.由于屏幕不会一次又一次地不必要地刷新,因此性能会有所提高。 The Equatable package generates hashes according to the parameters you add in the background. Equatable 包根据您在后台添加的参数生成哈希。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM