JSONFormat4Flutter icon indicating copy to clipboard operation
JSONFormat4Flutter copied to clipboard

生成 "operator ==" 和 "hashCode" 方法

Open TshineZheng opened this issue 6 years ago • 0 comments

在开发中,生成的代码有时候直接拿来当做程序中的 Info 类用。 如果遇到需要判断 Info 类是否相等时,就需要写转换类,或手动增加这两个方法。 既然这样,何不自动生成?反正就算不使用也不会有什么影响。

为了简洁方便,用了 built_value 中的 hashCode 生成函数,略不妥。 我对 python 不太熟悉,所以 pr 中的代码纯粹是依葫芦画瓢,若合并,望检查。

TshineZheng avatar Feb 21 '19 15:02 TshineZheng