mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat: scroll to top & view in timeline (#20274)
* feat: scroll to top & view in timeline * use EventStream * refactor: event invocation and listerner * fix: correct parent routing
This commit is contained in:
parent
6becf409da
commit
d15f67da5d
8 changed files with 114 additions and 25 deletions
|
|
@ -4,8 +4,9 @@ import 'package:auto_route/auto_route.dart';
|
|||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:immich_mobile/domain/models/memory.model.dart';
|
||||
|
||||
import 'package:immich_mobile/providers/asset_viewer/scroll_to_date_notifier.provider.dart';
|
||||
import 'package:immich_mobile/domain/models/timeline.model.dart';
|
||||
import 'package:immich_mobile/domain/utils/event_stream.dart';
|
||||
import 'package:immich_mobile/routing/router.dart';
|
||||
|
||||
class DriftMemoryBottomInfo extends StatelessWidget {
|
||||
final DriftMemory memory;
|
||||
|
|
@ -44,18 +45,22 @@ class DriftMemoryBottomInfo extends StatelessWidget {
|
|||
),
|
||||
],
|
||||
),
|
||||
MaterialButton(
|
||||
minWidth: 0,
|
||||
onPressed: () {
|
||||
context.maybePop();
|
||||
scrollToDateNotifierProvider.scrollToDate(fileCreatedDate);
|
||||
},
|
||||
shape: const CircleBorder(),
|
||||
color: Colors.white.withValues(alpha: 0.2),
|
||||
elevation: 0,
|
||||
child: const Icon(
|
||||
Icons.open_in_new,
|
||||
color: Colors.white,
|
||||
Tooltip(
|
||||
message: 'view_in_timeline'.tr(),
|
||||
child: MaterialButton(
|
||||
minWidth: 0,
|
||||
onPressed: () {
|
||||
context.maybePop();
|
||||
context.navigateTo(const TabShellRoute(children: [MainTimelineRoute()]));
|
||||
EventStream.shared.emit(ScrollToDateEvent(fileCreatedDate));
|
||||
},
|
||||
shape: const CircleBorder(),
|
||||
color: Colors.white.withValues(alpha: 0.2),
|
||||
elevation: 0,
|
||||
child: const Icon(
|
||||
Icons.open_in_new,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
]),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue