1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-03 09:59:32 +02:00
immich/mobile/lib/models/memories/memory.model.dart
Alex f057fe045e
refactor(mobile): entities and models (#9182)
* refactor(mobile): entities

* store entity

* refactor: models

* remove domain

* save all

* bad refactor
2024-04-30 21:36:40 -05:00

41 lines
894 B
Dart

// ignore_for_file: public_member_api_docs, sort_constructors_first
import 'package:collection/collection.dart';
import 'package:immich_mobile/entities/asset.entity.dart';
class Memory {
final String title;
final List<Asset> assets;
Memory({
required this.title,
required this.assets,
});
Memory copyWith({
String? title,
List<Asset>? assets,
}) {
return Memory(
title: title ?? this.title,
assets: assets ?? this.assets,
);
}
@override
String toString() => 'Memory(title: $title, assets: $assets)';
@override
bool operator ==(Object other) {
if (identical(this, other)) return true;
final listEquals = const DeepCollectionEquality().equals;
return other is Memory &&
other.title == title &&
listEquals(other.assets, assets);
}
@override
int get hashCode => title.hashCode ^ assets.hashCode;
}