2023-06-27 16:00:20 -05:00
|
|
|
// ignore_for_file: public_member_api_docs, sort_constructors_first
|
|
|
|
|
|
|
|
|
|
import 'package:collection/collection.dart';
|
|
|
|
|
|
2024-04-30 21:36:40 -05:00
|
|
|
import 'package:immich_mobile/entities/asset.entity.dart';
|
2023-06-27 16:00:20 -05:00
|
|
|
|
|
|
|
|
class Memory {
|
|
|
|
|
final String title;
|
|
|
|
|
final List<Asset> assets;
|
2025-07-29 00:34:03 +05:30
|
|
|
const Memory({required this.title, required this.assets});
|
|
|
|
|
|
|
|
|
|
Memory copyWith({String? title, List<Asset>? assets}) {
|
|
|
|
|
return Memory(title: title ?? this.title, assets: assets ?? this.assets);
|
2023-06-27 16:00:20 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
String toString() => 'Memory(title: $title, assets: $assets)';
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
bool operator ==(Object other) {
|
|
|
|
|
if (identical(this, other)) return true;
|
|
|
|
|
final listEquals = const DeepCollectionEquality().equals;
|
|
|
|
|
|
2025-07-25 08:07:22 +05:30
|
|
|
return other is Memory && other.title == title && listEquals(other.assets, assets);
|
2023-06-27 16:00:20 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
int get hashCode => title.hashCode ^ assets.hashCode;
|
|
|
|
|
}
|