2024-01-05 00:20:55 -05:00
|
|
|
import 'package:auto_route/auto_route.dart';
|
2024-04-05 09:45:37 -05:00
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
2023-05-24 22:52:43 -05:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
2023-11-09 11:19:53 -05:00
|
|
|
import 'package:immich_mobile/extensions/build_context_extensions.dart';
|
2023-05-24 22:52:43 -05:00
|
|
|
import 'package:immich_mobile/routing/router.dart';
|
2024-04-30 21:36:40 -05:00
|
|
|
import 'package:immich_mobile/entities/user.entity.dart';
|
2024-05-06 23:04:21 -05:00
|
|
|
import 'package:immich_mobile/widgets/common/user_avatar.dart';
|
2023-05-24 22:52:43 -05:00
|
|
|
|
|
|
|
class PartnerList extends HookConsumerWidget {
|
2024-01-27 11:14:32 -05:00
|
|
|
const PartnerList({super.key, required this.partner});
|
2023-05-24 22:52:43 -05:00
|
|
|
|
|
|
|
final List<User> partner;
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
|
|
return SliverList(
|
|
|
|
delegate:
|
|
|
|
SliverChildBuilderDelegate(listEntry, childCount: partner.length),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
Widget listEntry(BuildContext context, int index) {
|
|
|
|
final User p = partner[index];
|
|
|
|
return ListTile(
|
2023-11-12 00:02:26 -05:00
|
|
|
contentPadding: const EdgeInsets.only(
|
|
|
|
left: 12.0,
|
|
|
|
right: 18.0,
|
|
|
|
),
|
|
|
|
leading: userAvatar(context, p, radius: 24),
|
2023-06-28 22:33:57 -05:00
|
|
|
title: Text(
|
2024-04-05 09:45:37 -05:00
|
|
|
"partner_list_user_photos",
|
2023-11-20 09:58:03 -05:00
|
|
|
style: context.textTheme.labelLarge,
|
2024-04-05 09:45:37 -05:00
|
|
|
).tr(
|
|
|
|
namedArgs: {
|
|
|
|
'user': p.name,
|
|
|
|
},
|
2023-11-12 00:02:26 -05:00
|
|
|
),
|
|
|
|
trailing: Text(
|
2024-04-05 09:45:37 -05:00
|
|
|
"partner_list_view_all",
|
2023-11-20 09:58:03 -05:00
|
|
|
style: context.textTheme.labelLarge?.copyWith(
|
2023-11-09 11:19:53 -05:00
|
|
|
color: context.primaryColor,
|
2023-06-28 22:33:57 -05:00
|
|
|
),
|
2024-04-05 09:45:37 -05:00
|
|
|
).tr(),
|
2024-01-05 00:20:55 -05:00
|
|
|
onTap: () => context.pushRoute((PartnerDetailRoute(partner: p))),
|
2023-05-24 22:52:43 -05:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|