mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat: memories in new timeline (#19720)
* feat: memories sliver * memories lane * display and show memory * fix: get correct memories * naming * pr feedback * use equalsValue for visibility --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
181efb9010
commit
4a2cf28882
15 changed files with 958 additions and 74 deletions
|
|
@ -1,7 +1,9 @@
|
|||
import 'package:auto_route/auto_route.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:immich_mobile/presentation/widgets/memory/memory_lane.widget.dart';
|
||||
import 'package:immich_mobile/presentation/widgets/timeline/timeline.widget.dart';
|
||||
import 'package:immich_mobile/providers/infrastructure/memory.provider.dart';
|
||||
|
||||
@RoutePage()
|
||||
class MainTimelinePage extends ConsumerWidget {
|
||||
|
|
@ -9,6 +11,22 @@ class MainTimelinePage extends ConsumerWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
return const Timeline();
|
||||
final memoryLaneProvider = ref.watch(driftMemoryFutureProvider);
|
||||
|
||||
return memoryLaneProvider.when(
|
||||
data: (memories) {
|
||||
return memories.isEmpty
|
||||
? const Timeline()
|
||||
: Timeline(
|
||||
topSliverWidget: SliverToBoxAdapter(
|
||||
key: Key('memory-lane-${memories.first.assets.first.id}'),
|
||||
child: DriftMemoryLane(memories: memories),
|
||||
),
|
||||
topSliverWidgetHeight: 200,
|
||||
);
|
||||
},
|
||||
loading: () => const Timeline(),
|
||||
error: (error, stackTrace) => const Timeline(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue