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 {
|
|
|
|
const PartnerList({Key? key, required this.partner}) : super(key: key);
|
|
|
|
|
|
|
|
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(
|
2023-11-12 03:03:32 +02:00
|
|
|
"${p.name}'s photos",
|
2023-11-20 16:58:03 +02:00
|
|
|
style: context.textTheme.labelLarge,
|
2023-11-12 07:02:26 +02:00
|
|
|
),
|
|
|
|
trailing: Text(
|
|
|
|
"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
|
|
|
),
|
|
|
|
),
|
2023-11-09 18:19:53 +02:00
|
|
|
onTap: () => context.autoPush((PartnerDetailRoute(partner: p))),
|
2023-05-25 05:52:43 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|