|
|
|
|
@ -5,6 +5,7 @@ import 'package:immich_mobile/providers/activity_statistics.provider.dart';
|
|
|
|
|
import 'package:immich_mobile/providers/album/current_album.provider.dart';
|
|
|
|
|
import 'package:immich_mobile/entities/asset.entity.dart';
|
|
|
|
|
import 'package:immich_mobile/providers/asset.provider.dart';
|
|
|
|
|
import 'package:immich_mobile/providers/tab.provider.dart';
|
|
|
|
|
import 'package:immich_mobile/widgets/asset_viewer/motion_photo_button.dart';
|
|
|
|
|
|
|
|
|
|
class TopControlAppBar extends HookConsumerWidget {
|
|
|
|
|
@ -13,6 +14,7 @@ class TopControlAppBar extends HookConsumerWidget {
|
|
|
|
|
required this.asset,
|
|
|
|
|
required this.onMoreInfoPressed,
|
|
|
|
|
required this.onDownloadPressed,
|
|
|
|
|
required this.onLocatePressed,
|
|
|
|
|
required this.onAddToAlbumPressed,
|
|
|
|
|
required this.onRestorePressed,
|
|
|
|
|
required this.onFavorite,
|
|
|
|
|
@ -26,6 +28,7 @@ class TopControlAppBar extends HookConsumerWidget {
|
|
|
|
|
final Function onMoreInfoPressed;
|
|
|
|
|
final VoidCallback? onUploadPressed;
|
|
|
|
|
final VoidCallback? onDownloadPressed;
|
|
|
|
|
final VoidCallback onLocatePressed;
|
|
|
|
|
final VoidCallback onAddToAlbumPressed;
|
|
|
|
|
final VoidCallback onRestorePressed;
|
|
|
|
|
final VoidCallback onActivitiesPressed;
|
|
|
|
|
@ -54,6 +57,18 @@ class TopControlAppBar extends HookConsumerWidget {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget buildLocateButton() {
|
|
|
|
|
return IconButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
onLocatePressed();
|
|
|
|
|
},
|
|
|
|
|
icon: Icon(
|
|
|
|
|
Icons.image_search,
|
|
|
|
|
color: Colors.grey[200],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget buildMoreInfoButton() {
|
|
|
|
|
return IconButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
@ -159,6 +174,8 @@ class TopControlAppBar extends HookConsumerWidget {
|
|
|
|
|
shape: const Border(),
|
|
|
|
|
actions: [
|
|
|
|
|
if (asset.isRemote && isOwner) buildFavoriteButton(a),
|
|
|
|
|
if (isOwner && ref.read(tabProvider.notifier).state != TabEnum.home)
|
|
|
|
|
buildLocateButton(),
|
|
|
|
|
if (asset.livePhotoVideoId != null) const MotionPhotoButton(),
|
|
|
|
|
if (asset.isLocal && !asset.isRemote) buildUploadButton(),
|
|
|
|
|
if (asset.isRemote && !asset.isLocal && isOwner) buildDownloadButton(),
|
|
|
|
|
|