Skip to content

Commit a7c0423

Browse files
committed
msglist: Adjust padding around message list sender
Paddings could be combined (for example the padding around the user avatar and name could be included with the outer padding around the `senderWidget`) but left according to the Figma specifications as this increases the hit target of the sender so is useful to have.
1 parent 35a6ee7 commit a7c0423

File tree

1 file changed

+26
-27
lines changed

1 file changed

+26
-27
lines changed

lib/widgets/message_list.dart

+26-27
Original file line numberDiff line numberDiff line change
@@ -785,19 +785,20 @@ class MessageWithPossibleSender extends StatelessWidget {
785785

786786
final Widget senderWidget;
787787
if (item.showSender) {
788-
senderWidget = Column(
789-
children: [
790-
const SizedBox(height: 3),
791-
Row(
792-
mainAxisAlignment: MainAxisAlignment.spaceBetween,
793-
crossAxisAlignment: CrossAxisAlignment.baseline,
794-
textBaseline: TextBaseline.alphabetic,
795-
children: [
796-
Flexible(
797-
child: GestureDetector(
798-
onTap: () => Navigator.push(context,
799-
ProfilePage.buildRoute(context: context,
800-
userId: message.senderId)),
788+
senderWidget = Padding(
789+
padding: const EdgeInsets.symmetric(vertical: 2),
790+
child: Row(
791+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
792+
crossAxisAlignment: CrossAxisAlignment.baseline,
793+
textBaseline: TextBaseline.alphabetic,
794+
children: [
795+
Flexible(
796+
child: GestureDetector(
797+
onTap: () => Navigator.push(context,
798+
ProfilePage.buildRoute(context: context,
799+
userId: message.senderId)),
800+
child: Padding(
801+
padding: const EdgeInsets.symmetric(vertical: 2),
801802
child: Row(
802803
children: [
803804
Avatar(size: 32, borderRadius: 3, userId: message.senderId),
@@ -812,20 +813,18 @@ class MessageWithPossibleSender extends StatelessWidget {
812813
wghtIfPlatformRequestsBold: 900)),
813814
overflow: TextOverflow.ellipsis),
814815
),
815-
])),
816-
),
817-
Text(time,
818-
style: TextStyle(
819-
color: _kMessageTimestampColor,
820-
fontFamily: 'Source Sans 3',
821-
fontSize: 16,
822-
height: (18 / 16),
823-
fontFeatures: const [FontFeature.enable('c2sc'), FontFeature.enable('smcp')],
824-
).merge(weightVariableTextStyle(context))),
825-
]),
826-
const SizedBox(height: 4),
827-
],
828-
);
816+
]),
817+
)),
818+
),
819+
Text(time,
820+
style: TextStyle(
821+
color: _kMessageTimestampColor,
822+
fontFamily: 'Source Sans 3',
823+
fontSize: 16,
824+
height: (18 / 16),
825+
fontFeatures: const [FontFeature.enable('c2sc'), FontFeature.enable('smcp')],
826+
).merge(weightVariableTextStyle(context))),
827+
]));
829828
} else {
830829
senderWidget = const SizedBox.shrink();
831830
}

0 commit comments

Comments
 (0)