Skip to content

Commit

Permalink
msglist: Adjust padding around message list sender
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sirpengi committed Dec 8, 2023
1 parent db1401d commit c86f1fb
Showing 1 changed file with 26 additions and 27 deletions.
53 changes: 26 additions & 27 deletions lib/widgets/message_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -785,19 +785,20 @@ class MessageWithPossibleSender extends StatelessWidget {

final Widget senderWidget;
if (item.showSender) {
senderWidget = Column(
children: [
const SizedBox(height: 3),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.baseline,
textBaseline: TextBaseline.alphabetic,
children: [
Flexible(
child: GestureDetector(
onTap: () => Navigator.push(context,
ProfilePage.buildRoute(context: context,
userId: message.senderId)),
senderWidget = Padding(
padding: const EdgeInsets.symmetric(vertical: 2),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.baseline,
textBaseline: TextBaseline.alphabetic,
children: [
Flexible(
child: GestureDetector(
onTap: () => Navigator.push(context,
ProfilePage.buildRoute(context: context,
userId: message.senderId)),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 2),
child: Row(
children: [
Avatar(size: 32, borderRadius: 3, userId: message.senderId),
Expand All @@ -812,20 +813,18 @@ class MessageWithPossibleSender extends StatelessWidget {
wghtIfPlatformRequestsBold: 900)),
overflow: TextOverflow.ellipsis),
),
])),
),
Text(time,
style: TextStyle(
color: _kMessageTimestampColor,
fontFamily: 'Source Sans 3',
fontSize: 16,
height: (18 / 16),
fontFeatures: const [FontFeature.enable('c2sc'), FontFeature.enable('smcp')],
).merge(weightVariableTextStyle(context))),
]),
const SizedBox(height: 4),
],
);
]),
)),
),
Text(time,
style: TextStyle(
color: _kMessageTimestampColor,
fontFamily: 'Source Sans 3',
fontSize: 16,
height: (18 / 16),
fontFeatures: const [FontFeature.enable('c2sc'), FontFeature.enable('smcp')],
).merge(weightVariableTextStyle(context))),
]));
} else {
senderWidget = const SizedBox.shrink();
}
Expand Down

0 comments on commit c86f1fb

Please sign in to comment.