Notification Screen and tasq_adaptive_list enhancements

This commit is contained in:
2026-05-11 11:34:34 +08:00
parent 30b301765b
commit e9d1af867a
8 changed files with 499 additions and 165 deletions
+80 -15
View File
@@ -195,26 +195,91 @@ class _TeamsScreenState extends ConsumerState<TeamsScreen> {
officeNamesList.sort(
(a, b) => a.toLowerCase().compareTo(b.toLowerCase()),
);
final officeNames = officeNamesList.join(', ');
final members = team.members(teamMembers);
final memberNames = members
.map((id) => profileById[id]?.fullName ?? id)
.join(', ');
return ListTile(
title: Text(team.name),
subtitle: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Leader: ${leader?.fullName ?? team.leaderId}'),
Text('Offices: $officeNames'),
Text('Members: $memberNames'),
],
),
trailing: Row(
mainAxisSize: MainAxisSize.min,
children: actions,
),
final cs = Theme.of(context).colorScheme;
final tt = Theme.of(context).textTheme;
return M3PressScale(
onTap: () => _showTeamDialog(context, team: team),
child: Card(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 12,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
CircleAvatar(
radius: 20,
backgroundColor: cs.primaryContainer,
child: Text(
team.name.isNotEmpty
? team.name[0].toUpperCase()
: '?',
style: TextStyle(
color: cs.onPrimaryContainer,
fontWeight: FontWeight.bold,
),
),
),
const SizedBox(width: 12),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(team.name, style: tt.titleSmall),
const SizedBox(height: 2),
Text(
leader?.fullName ?? team.leaderId,
style: tt.bodySmall?.copyWith(
color: cs.onSurfaceVariant,
),
),
if (officeNamesList.isNotEmpty) ...[
const SizedBox(height: 6),
Wrap(
spacing: 4,
runSpacing: 4,
children: [
for (final office in officeNamesList)
Chip(
label: Text(
office,
style: const TextStyle(fontSize: 11),
),
materialTapTargetSize:
MaterialTapTargetSize.shrinkWrap,
visualDensity: VisualDensity.compact,
padding: EdgeInsets.zero,
),
],
),
],
if (memberNames.isNotEmpty) ...[
const SizedBox(height: 4),
Text(
memberNames,
style: tt.bodySmall?.copyWith(
color: cs.onSurfaceVariant,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
],
],
),
),
Column(
mainAxisSize: MainAxisSize.min,
children: actions,
),
],
),
),
),
);
},
rowActions: (team) => [