equals method
- @Deprecated('Use the `==` operator instead. Generated models now provide value ' 'equality via EquatableMixin and equals() will be removed in a future ' 'release.')
- dynamic other
Compares the BaseModel with another BaseModel using the
DeepCollectionEquality and returns true if they are equal.
Prefer ==. Models generated by df_generate_dart_models mix in
EquatableMixin and provide value-based equality through the ==
operator using the same field list, but without the per-call toJson
round-trip this method performs. Retained for one release for
callers still on older generated output.
Implementation
@Deprecated(
'Use the `==` operator instead. Generated models now provide value '
'equality via EquatableMixin and equals() will be removed in a future '
'release.',
)
bool equals(dynamic other) {
if (other is BaseModel) {
return const DeepCollectionEquality().equals(other.toJson(), toJson());
} else {
return false;
}
}