Skip to content

Commit 6cae44b

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 3ef062c commit 6cae44b

File tree

1 file changed

+27
-28
lines changed

1 file changed

+27
-28
lines changed

lib/widgets/message_list.dart

+27-28
Original file line numberDiff line numberDiff line change
@@ -786,20 +786,21 @@ class MessageWithPossibleSender extends StatelessWidget {
786786

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

0 commit comments

Comments
 (0)