Skip to content

Commit 6a5c6ad

Browse files
committed
msglist: Combine avatar image and user name in message sender
1 parent 71b9ba5 commit 6a5c6ad

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

lib/widgets/message_list.dart

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -789,16 +789,7 @@ class MessageWithPossibleSender extends StatelessWidget {
789789
child: Padding(
790790
padding: const EdgeInsets.only(top: 2, bottom: 3, left: 8, right: 8),
791791
child: Row(crossAxisAlignment: CrossAxisAlignment.start, children: [
792-
item.showSender
793-
? Padding(
794-
padding: const EdgeInsets.fromLTRB(3, 6, 11, 0),
795-
child: GestureDetector(
796-
onTap: () => Navigator.push(context,
797-
ProfilePage.buildRoute(context: context,
798-
userId: message.senderId)),
799-
child: Avatar(size: 32, borderRadius: 3,
800-
userId: message.senderId)))
801-
: const SizedBox(width: 3 + 35 + 11),
792+
const SizedBox(width: 3 + 35 + 11),
802793
Expanded(
803794
child: Column(
804795
crossAxisAlignment: CrossAxisAlignment.stretch,
@@ -809,13 +800,21 @@ class MessageWithPossibleSender extends StatelessWidget {
809800
onTap: () => Navigator.push(context,
810801
ProfilePage.buildRoute(context: context,
811802
userId: message.senderId)),
812-
child: Text(message.senderFullName, // TODO get from user data
813-
style: const TextStyle(
814-
fontFamily: 'Source Sans 3',
815-
fontSize: 18,
816-
height: (22 / 18),
817-
).merge(weightVariableTextStyle(context, wght: 600,
818-
wghtIfPlatformRequestsBold: 900)))),
803+
child: Row(
804+
children: [
805+
Avatar(size: 32, borderRadius: 3, userId: message.senderId),
806+
const SizedBox(width: 8),
807+
Flexible(
808+
child: Text(message.senderFullName, // TODO get from user data
809+
style: const TextStyle(
810+
fontFamily: 'Source Sans 3',
811+
fontSize: 18,
812+
height: (22 / 18),
813+
).merge(weightVariableTextStyle(context, wght: 600,
814+
wghtIfPlatformRequestsBold: 900)),
815+
overflow: TextOverflow.ellipsis),
816+
),
817+
])),
819818
const SizedBox(height: 4),
820819
],
821820
MessageContent(message: message, content: item.content),

0 commit comments

Comments
 (0)