2024-12-16 10:11:48 -06:00
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
|
|
|
import 'package:immich_mobile/widgets/album/album_action_filled_button.dart';
|
|
|
|
|
|
|
|
|
|
class AlbumControlButton extends ConsumerWidget {
|
2025-07-15 20:37:44 -05:00
|
|
|
final void Function()? onAddPhotosPressed;
|
|
|
|
|
final void Function()? onAddUsersPressed;
|
2024-12-16 10:11:48 -06:00
|
|
|
|
2025-07-29 00:34:03 +05:30
|
|
|
const AlbumControlButton({super.key, this.onAddPhotosPressed, this.onAddUsersPressed});
|
2024-12-16 10:11:48 -06:00
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
2025-07-15 20:37:44 -05:00
|
|
|
return SizedBox(
|
|
|
|
|
height: 36,
|
|
|
|
|
child: ListView(
|
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
|
children: [
|
|
|
|
|
if (onAddPhotosPressed != null)
|
2024-12-16 10:11:48 -06:00
|
|
|
AlbumActionFilledButton(
|
|
|
|
|
key: const ValueKey('add_photos_button'),
|
|
|
|
|
iconData: Icons.add_photo_alternate_outlined,
|
|
|
|
|
onPressed: onAddPhotosPressed,
|
2025-04-15 10:54:26 -05:00
|
|
|
labelText: "add_photos".tr(),
|
2024-12-16 10:11:48 -06:00
|
|
|
),
|
2025-07-15 20:37:44 -05:00
|
|
|
if (onAddUsersPressed != null)
|
|
|
|
|
AlbumActionFilledButton(
|
|
|
|
|
key: const ValueKey('add_users_button'),
|
|
|
|
|
iconData: Icons.person_add_alt_rounded,
|
|
|
|
|
onPressed: onAddUsersPressed,
|
|
|
|
|
labelText: "album_viewer_page_share_add_users".tr(),
|
|
|
|
|
),
|
|
|
|
|
],
|
2024-12-16 10:11:48 -06:00
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|