switch to equatablevalue
This commit is contained in:
@@ -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];
|
||||
}
|
||||
Reference in New Issue
Block a user