more refactors and logs page handling

This commit is contained in:
shenlong-tanwen
2024-10-23 02:30:46 +05:30
parent 8f47645cdb
commit a0afea04d8
90 changed files with 2386 additions and 584 deletions
@@ -4,8 +4,9 @@ import 'package:immich_mobile/domain/models/render_list_element.model.dart';
class RenderList {
final List<RenderListElement> elements;
late final int totalCount;
final DateTime modifiedTime;
RenderList({required this.elements}) {
RenderList({required this.elements, required this.modifiedTime}) {
final lastAssetElement =
elements.whereType<RenderListAssetElement>().lastOrNull;
if (lastAssetElement == null) {
@@ -16,6 +17,21 @@ class RenderList {
}
factory RenderList.empty() {
return RenderList(elements: []);
return RenderList(elements: [], modifiedTime: DateTime.now());
}
@override
String toString() =>
'RenderList(totalCount: $totalCount, modifiedTime: $modifiedTime)';
@override
bool operator ==(covariant RenderList other) {
if (identical(this, other)) return true;
return other.totalCount == totalCount &&
other.modifiedTime.isAtSameMomentAs(modifiedTime);
}
@override
int get hashCode => totalCount.hashCode ^ modifiedTime.hashCode;
}