File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -202,6 +202,24 @@ class TextProp extends Equatable with SerializableMixin {
202202 isJsonPath: isJsonPath ?? this .isJsonPath,
203203 );
204204
205+ /// Returns true if this instance is equivalent to the [other] .
206+ /// The reason this comparison is not done in [Equatable] is because
207+ /// [fills] is a list of [PaintModel] s which each has their own
208+ /// id, differentiating them from each other. So, we need to compare
209+ /// each [PaintModel] in the list.
210+ bool isEquivalentTo (TextProp ? other) {
211+ return other != null &&
212+ fills.length == other.fills.length &&
213+ fills.every ((e) => other.fills.contains (e)) &&
214+ textDecoration == other.textDecoration &&
215+ fontSize == other.fontSize &&
216+ letterSpacing == other.letterSpacing &&
217+ fontName == other.fontName &&
218+ lineHeight == other.lineHeight &&
219+ link == other.link &&
220+ isJsonPath == other.isJsonPath;
221+ }
222+
205223 @override
206224 List <Object > get props => [
207225 fills,
You can’t perform that action at this time.
0 commit comments