Skip to content

Commit 3b20b77

Browse files
Update message_list.dart
Add avatars to DM recipient headers. Display user avatars alongside names in DM recipient headers, making conversations more visually identifiable. This matches the RN app's behavior The changes: - Add Avatar widgets in DM recipient headers - Maintain consistent sizing and spacing (35px size, 8px right padding) - Handle overflow gracefully for both avatars and names Fixes #41
1 parent 347e19e commit 3b20b77

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

lib/widgets/message_list.dart

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,23 @@ class MessageListAppBarTitle extends StatelessWidget {
361361
if (otherRecipientIds.isEmpty) {
362362
return const Text("DMs with yourself");
363363
} else {
364-
final names = otherRecipientIds.map((id) => store.users[id]?.fullName ?? '(unknown user)');
365-
return Text("DMs with ${names.join(", ")}"); // TODO show avatars
364+
return Row(
365+
children: [
366+
...otherRecipientIds.map((id) =>
367+
Padding(
368+
padding: const EdgeInsets.only(right: 8),
369+
child: Avatar(size: 35, borderRadius: 32 / 8, userId: id),
370+
)),
371+
Expanded(
372+
child: Text(
373+
otherRecipientIds
374+
.map((id) => store.users[id]?.fullName ?? '(unknown user)')
375+
.join(", "),
376+
overflow: TextOverflow.ellipsis,
377+
),
378+
)
379+
]
380+
);
366381
}
367382
}
368383
}

0 commit comments

Comments
 (0)