switch to equatablevalue

This commit is contained in:
Fabian Freund
2025-02-28 14:43:50 +01:00
parent ef2a3505a1
commit 200c82a442
16 changed files with 82 additions and 130 deletions
+2 -10
View File
@@ -2,17 +2,9 @@ import 'dart:ui';
class EquatableImage {
final Image value;
final int? _imageHash;
final int _imageHash;
EquatableImage(this.value, {required int? hash}) : _imageHash = hash;
//For now we only calculate the has from encoded image on decoding
// static Future<EquatableImage> calculate(Image image) async {
// final imageHash = await image.calculateHash();
// return EquatableImage(image, hash: imageHash);
// }
EquatableImage(this.value, {required int hash}) : _imageHash = hash;
@override
int get hashCode => _imageHash.hashCode;
@@ -1,18 +0,0 @@
import 'package:fast_equatable/fast_equatable.dart';
class EquatableCollection<T> with FastEquatable {
final T collection;
final bool immutable;
EquatableCollection(this.collection, {required this.immutable})
: assert(
collection is Map || collection is Iterable || collection == null,
'Collection type not supported',
);
@override
bool get cacheHash => immutable;
@override
List<Object?> get hashParameters => [collection, immutable];
}