Skip to content

Commit b8e91cf

Browse files
committed
⚡ Update comparison for image provider.
1 parent 0876f37 commit b8e91cf

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

lib/src/provider/asset_entity_image_provider.dart

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,17 +126,25 @@ class AssetEntityImageProvider extends ImageProvider<AssetEntityImageProvider> {
126126
if (other.runtimeType != runtimeType) {
127127
return false;
128128
}
129-
final AssetEntityImageProvider typedOther =
130-
// ignore: test_types_in_equals
131-
other as AssetEntityImageProvider;
132-
return entity == typedOther.entity &&
133-
scale == typedOther.scale &&
134-
thumbSize == typedOther.thumbSize &&
135-
isOriginal == typedOther.isOriginal;
129+
if (identical(this, other)) {
130+
return true;
131+
}
132+
return entity == other.entity &&
133+
scale == other.scale &&
134+
thumbSize == other.thumbSize &&
135+
isOriginal == other.isOriginal;
136136
}
137137

138138
@override
139-
int get hashCode => hashValues(entity, scale, isOriginal);
139+
int get hashCode {
140+
return hashValues(
141+
entity,
142+
scale,
143+
thumbSize?.elementAt(0) ?? 0,
144+
thumbSize?.elementAt(1) ?? 0,
145+
isOriginal,
146+
);
147+
}
140148
}
141149

142150
enum ImageFileType { jpg, png, gif, tiff, heic, other }

0 commit comments

Comments
 (0)