Skip to content

Commit 25f04ca

Browse files
committed
msglist: Combine avatar image and user name in message sender
1 parent 032a157 commit 25f04ca

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

lib/widgets/message_list.dart

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

0 commit comments

Comments
 (0)