Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions apps/client/lib/src/widgets/chat_panel/chat_message_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,13 @@ class ChatMessageList extends ConsumerWidget {
child: MessageListSkeleton(),
);
} else if (messages.isEmpty && !isLoadingHistory) {
final peer = conv.members.where((m) => m.userId != myUserId).firstOrNull;
child = KeyedSubtree(
key: const ValueKey('empty'),
child: EmptyMessagePlaceholder(
userId: peer?.userId ?? '',
displayName: displayName,
avatarUrl: peer == null ? null : memberAvatars[peer.userId],
onSayHi: onSayHi,
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@
import 'package:flutter/material.dart';

import '../../theme/echo_theme.dart';
import '../user_avatar.dart';

class EmptyMessagePlaceholder extends StatelessWidget {
final String userId;
final String displayName;
final String? avatarUrl;
final VoidCallback onSayHi;

const EmptyMessagePlaceholder({
super.key,
required this.userId,
required this.displayName,
required this.onSayHi,
this.avatarUrl,
});

@override
Expand All @@ -19,13 +24,13 @@ class EmptyMessagePlaceholder extends StatelessWidget {
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
CircleAvatar(
UserAvatar(
userId: userId,
username: displayName,
avatarUrl: avatarUrl,
radius: 28,
backgroundColor: context.accent,
child: Text(
displayName.isNotEmpty ? displayName[0].toUpperCase() : '?',
style: TextStyle(fontSize: 22, color: context.onAccent),
),
bgColor: context.accent,
openProfileOnTap: false,
),
const SizedBox(height: 12),
Text(
Expand Down
Loading