Files
MrbWebLibre/app/lib/data/models/equatable_iterable.dart
T
2024-10-15 11:13:32 +02:00

22 lines
493 B
Dart

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 type not supported',
);
@override
bool get cacheHash => immutable;
@override
List<Object?> get hashParameters => [
collection,
immutable,
];
}