mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
feat(mobile): memories (#2988)
* Add page view * Nice page view * refactor file structure * Added card * invalidating data * transition * styling * correct styleing * refactor * click to navigate * styling * TODO * clean up * clean up * pr feedback * pr feedback * better loading indicator
This commit is contained in:
40
mobile/lib/modules/memories/models/memory.dart
Normal file
40
mobile/lib/modules/memories/models/memory.dart
Normal file
@@ -0,0 +1,40 @@
|
||||
// ignore_for_file: public_member_api_docs, sort_constructors_first
|
||||
|
||||
import 'package:collection/collection.dart';
|
||||
|
||||
import 'package:immich_mobile/shared/models/asset.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;
|
||||
}
|
||||
Reference in New Issue
Block a user