diff --git a/packages/freezed_annotation/lib/freezed_annotation.dart b/packages/freezed_annotation/lib/freezed_annotation.dart index 9a5f4631..a7733f0f 100644 --- a/packages/freezed_annotation/lib/freezed_annotation.dart +++ b/packages/freezed_annotation/lib/freezed_annotation.dart @@ -18,11 +18,11 @@ class EqualUnmodifiableListView extends UnmodifiableListView { bool operator ==(Object other) { return other is EqualUnmodifiableListView && other.runtimeType == runtimeType && - other._source == _source; + const DeepCollectionEquality().equals(other._source, _source); } @override - int get hashCode => Object.hash(runtimeType, _source); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_source)); } /// An [UnmodifiableSetView] which overrides == @@ -36,11 +36,11 @@ class EqualUnmodifiableSetView extends UnmodifiableSetView { bool operator ==(Object other) { return other is EqualUnmodifiableSetView && other.runtimeType == runtimeType && - other._source == _source; + const DeepCollectionEquality().equals(other._source, _source); } @override - int get hashCode => Object.hash(runtimeType, _source); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_source)); } /// An [UnmodifiableMapView] which overrides == @@ -55,11 +55,11 @@ class EqualUnmodifiableMapView bool operator ==(Object other) { return other is EqualUnmodifiableMapView && other.runtimeType == runtimeType && - other._source == _source; + const DeepCollectionEquality().equals(other._source, _source); } @override - int get hashCode => Object.hash(runtimeType, _source); + int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_source)); } /// Options for enabling/disabling specific `Union.map` features;