2024-01-05 07:20:55 +02:00
|
|
|
import 'package:auto_route/auto_route.dart';
|
2024-04-05 16:45:37 +02:00
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
2023-05-25 05:52:43 +02:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
2023-11-09 18:19:53 +02:00
|
|
|
import 'package:immich_mobile/extensions/build_context_extensions.dart';
|
2023-05-25 05:52:43 +02:00
|
|
|
import 'package:immich_mobile/routing/router.dart';
|
|
|
|
import 'package:immich_mobile/shared/models/user.dart';
|
|
|
|
import 'package:immich_mobile/shared/ui/user_avatar.dart';
|
|
|
|
|
|
|
|
class PartnerList extends HookConsumerWidget {
|
2024-01-27 18:14:32 +02:00
|
|
|
const PartnerList({super.key, required this.partner});
|
2023-05-25 05:52:43 +02: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 07:02:26 +02:00
|
|
|
contentPadding: const EdgeInsets.only(
|
|
|
|
left: 12.0,
|
|
|
|
right: 18.0,
|
|
|
|
),
|
|
|
|
leading: userAvatar(context, p, radius: 24),
|
2023-06-29 05:33:57 +02:00
|
|
|
title: Text(
|
2024-04-05 16:45:37 +02:00
|
|
|
"partner_list_user_photos",
|
2023-11-20 16:58:03 +02:00
|
|
|
style: context.textTheme.labelLarge,
|
2024-04-05 16:45:37 +02:00
|
|
|
).tr(
|
|
|
|
namedArgs: {
|
|
|
|
'user': p.name,
|
|
|
|
},
|
2023-11-12 07:02:26 +02:00
|
|
|
),
|
|
|
|
trailing: Text(
|
2024-04-05 16:45:37 +02:00
|
|
|
"partner_list_view_all",
|
2023-11-20 16:58:03 +02:00
|
|
|
style: context.textTheme.labelLarge?.copyWith(
|
2023-11-09 18:19:53 +02:00
|
|
|
color: context.primaryColor,
|
2023-06-29 05:33:57 +02:00
|
|
|
),
|
2024-04-05 16:45:37 +02:00
|
|
|
).tr(),
|
2024-01-05 07:20:55 +02:00
|
|
|
onTap: () => context.pushRoute((PartnerDetailRoute(partner: p))),
|
2023-05-25 05:52:43 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|