mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-22 16:56:19 +01:00
15 lines
370 B
Dart
15 lines
370 B
Dart
/// Override operator== of T
|
|
class OverrideComparator<T> {
|
|
OverrideComparator(this.obj, this.equalFn, this.hashCodeFn);
|
|
|
|
@override
|
|
operator ==(Object other) =>
|
|
other is OverrideComparator<T> && equalFn(obj, other.obj);
|
|
|
|
@override
|
|
get hashCode => hashCodeFn(obj);
|
|
|
|
final T obj;
|
|
final bool Function(T, T) equalFn;
|
|
final int Function(T) hashCodeFn;
|
|
}
|