fix: Timestamp alignment
This commit is contained in:
@@ -490,152 +490,165 @@ class _MessageWidgetState extends State<MessageWidget>
|
|||||||
? AlignmentDirectional.bottomEnd
|
? AlignmentDirectional.bottomEnd
|
||||||
: AlignmentDirectional.bottomStart,
|
: AlignmentDirectional.bottomStart,
|
||||||
children: [
|
children: [
|
||||||
Column(
|
Padding(
|
||||||
crossAxisAlignment: widget.reverse
|
padding: EdgeInsets.only(
|
||||||
? CrossAxisAlignment.end
|
bottom:
|
||||||
: CrossAxisAlignment.start,
|
isPinned && widget.showPinHighlight ? 8.0 : 0.0,
|
||||||
mainAxisSize: MainAxisSize.min,
|
),
|
||||||
children: [
|
child: Column(
|
||||||
if (widget.message.pinned &&
|
crossAxisAlignment: widget.reverse
|
||||||
widget.message.pinnedBy != null &&
|
? CrossAxisAlignment.end
|
||||||
widget.showPinHighlight)
|
: CrossAxisAlignment.start,
|
||||||
_buildPinnedMessage(widget.message),
|
mainAxisSize: MainAxisSize.min,
|
||||||
Row(
|
children: [
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
if (widget.message.pinned &&
|
||||||
mainAxisSize: MainAxisSize.min,
|
widget.message.pinnedBy != null &&
|
||||||
children: <Widget>[
|
widget.showPinHighlight)
|
||||||
if (widget.showUserAvatar == DisplayWidget.show &&
|
_buildPinnedMessage(widget.message),
|
||||||
widget.message.user != null) ...[
|
Row(
|
||||||
_buildUserAvatar(),
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
const SizedBox(width: 4),
|
mainAxisSize: MainAxisSize.min,
|
||||||
],
|
children: <Widget>[
|
||||||
if (widget.showUserAvatar == DisplayWidget.hide)
|
if (widget.showUserAvatar ==
|
||||||
SizedBox(width: avatarWidth + 4),
|
DisplayWidget.show &&
|
||||||
Flexible(
|
widget.message.user != null) ...[
|
||||||
child: PortalEntry(
|
_buildUserAvatar(),
|
||||||
portal: Container(
|
const SizedBox(width: 4),
|
||||||
transform: Matrix4.translationValues(
|
],
|
||||||
widget.reverse ? 12 : -12, 0, 0),
|
if (widget.showUserAvatar == DisplayWidget.hide)
|
||||||
constraints: const BoxConstraints(
|
SizedBox(width: avatarWidth + 4),
|
||||||
maxWidth: 22 * 6.0),
|
Flexible(
|
||||||
child: _buildReactionIndicator(context),
|
child: PortalEntry(
|
||||||
),
|
portal: Container(
|
||||||
portalAnchor:
|
transform: Matrix4.translationValues(
|
||||||
Alignment(widget.reverse ? 1 : -1, -1),
|
widget.reverse ? 12 : -12, 0, 0),
|
||||||
childAnchor:
|
constraints: const BoxConstraints(
|
||||||
Alignment(widget.reverse ? -1 : 1, -1),
|
maxWidth: 22 * 6.0),
|
||||||
child: Stack(
|
child: _buildReactionIndicator(context),
|
||||||
clipBehavior: Clip.none,
|
),
|
||||||
children: [
|
portalAnchor:
|
||||||
Padding(
|
Alignment(widget.reverse ? 1 : -1, -1),
|
||||||
padding: widget.showReactions
|
childAnchor:
|
||||||
? EdgeInsets.only(
|
Alignment(widget.reverse ? -1 : 1, -1),
|
||||||
top: widget
|
child: Stack(
|
||||||
.message
|
clipBehavior: Clip.none,
|
||||||
.reactionCounts
|
children: [
|
||||||
?.isNotEmpty ==
|
Padding(
|
||||||
true
|
padding: widget.showReactions
|
||||||
? 18
|
? EdgeInsets.only(
|
||||||
: 0,
|
top: widget
|
||||||
)
|
.message
|
||||||
: EdgeInsets.zero,
|
.reactionCounts
|
||||||
child: (widget.message.isDeleted &&
|
?.isNotEmpty ==
|
||||||
!isFailedState)
|
true
|
||||||
? Container(
|
? 18
|
||||||
// ignore: lines_longer_than_80_chars
|
: 0,
|
||||||
margin: EdgeInsets.symmetric(
|
)
|
||||||
horizontal:
|
: EdgeInsets.zero,
|
||||||
|
child: (widget.message.isDeleted &&
|
||||||
|
!isFailedState)
|
||||||
|
? Container(
|
||||||
|
// ignore: lines_longer_than_80_chars
|
||||||
|
margin: EdgeInsets.symmetric(
|
||||||
|
horizontal:
|
||||||
|
// ignore: lines_longer_than_80_chars
|
||||||
|
widget.showUserAvatar ==
|
||||||
|
// ignore: lines_longer_than_80_chars
|
||||||
|
DisplayWidget.gone
|
||||||
|
? 0
|
||||||
|
: 4.0),
|
||||||
|
child: DeletedMessage(
|
||||||
|
borderRadiusGeometry: widget
|
||||||
|
.borderRadiusGeometry,
|
||||||
|
borderSide:
|
||||||
|
widget.borderSide,
|
||||||
|
shape: widget.shape,
|
||||||
|
messageTheme:
|
||||||
|
widget.messageTheme,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: Card(
|
||||||
|
clipBehavior: Clip.antiAlias,
|
||||||
|
elevation: 0,
|
||||||
|
margin: EdgeInsets.symmetric(
|
||||||
|
horizontal: (isFailedState
|
||||||
|
? 15.0
|
||||||
|
: 0.0) +
|
||||||
// ignore: lines_longer_than_80_chars
|
// ignore: lines_longer_than_80_chars
|
||||||
widget.showUserAvatar ==
|
(widget.showUserAvatar ==
|
||||||
// ignore: lines_longer_than_80_chars
|
|
||||||
DisplayWidget
|
DisplayWidget
|
||||||
.gone
|
.gone
|
||||||
? 0
|
? 0
|
||||||
: 4.0),
|
: 4.0),
|
||||||
child: DeletedMessage(
|
),
|
||||||
borderRadiusGeometry: widget
|
shape: widget.shape ??
|
||||||
.borderRadiusGeometry,
|
RoundedRectangleBorder(
|
||||||
borderSide: widget.borderSide,
|
side: widget
|
||||||
shape: widget.shape,
|
.borderSide ??
|
||||||
messageTheme:
|
BorderSide(
|
||||||
widget.messageTheme,
|
color: widget
|
||||||
),
|
// ignore: lines_longer_than_80_chars
|
||||||
)
|
.messageTheme
|
||||||
: Card(
|
// ignore: lines_longer_than_80_chars
|
||||||
clipBehavior: Clip.antiAlias,
|
.messageBorderColor ??
|
||||||
elevation: 0,
|
Colors.grey,
|
||||||
margin: EdgeInsets.symmetric(
|
),
|
||||||
horizontal: (isFailedState
|
borderRadius: widget
|
||||||
? 15.0
|
// ignore: lines_longer_than_80_chars
|
||||||
: 0.0) +
|
.borderRadiusGeometry ??
|
||||||
// ignore: lines_longer_than_80_chars
|
BorderRadius.zero,
|
||||||
(widget.showUserAvatar ==
|
),
|
||||||
DisplayWidget.gone
|
color: _getBackgroundColor(),
|
||||||
? 0
|
child: Column(
|
||||||
: 4.0),
|
crossAxisAlignment:
|
||||||
),
|
CrossAxisAlignment.end,
|
||||||
shape: widget.shape ??
|
mainAxisSize:
|
||||||
RoundedRectangleBorder(
|
MainAxisSize.min,
|
||||||
side: widget.borderSide ??
|
children: <Widget>[
|
||||||
BorderSide(
|
if (hasQuotedMessage)
|
||||||
color: widget
|
_buildQuotedMessage(),
|
||||||
// ignore: lines_longer_than_80_chars
|
if (hasNonUrlAttachments)
|
||||||
.messageTheme
|
_parseAttachments(),
|
||||||
// ignore: lines_longer_than_80_chars
|
if (!isGiphy)
|
||||||
.messageBorderColor ??
|
_buildTextBubble(),
|
||||||
Colors.grey,
|
],
|
||||||
),
|
),
|
||||||
borderRadius: widget
|
|
||||||
// ignore: lines_longer_than_80_chars
|
|
||||||
.borderRadiusGeometry ??
|
|
||||||
BorderRadius.zero,
|
|
||||||
),
|
|
||||||
color: _getBackgroundColor(),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment:
|
|
||||||
CrossAxisAlignment.end,
|
|
||||||
mainAxisSize:
|
|
||||||
MainAxisSize.min,
|
|
||||||
children: <Widget>[
|
|
||||||
if (hasQuotedMessage)
|
|
||||||
_buildQuotedMessage(),
|
|
||||||
if (hasNonUrlAttachments)
|
|
||||||
_parseAttachments(),
|
|
||||||
if (!isGiphy)
|
|
||||||
_buildTextBubble(),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
if (widget.showReactionPickerIndicator)
|
||||||
|
Positioned(
|
||||||
|
right: widget.reverse ? null : 4,
|
||||||
|
left: widget.reverse ? 4 : null,
|
||||||
|
top: -8,
|
||||||
|
child: CustomPaint(
|
||||||
|
painter: ReactionBubblePainter(
|
||||||
|
StreamChatTheme.of(context)
|
||||||
|
.colorTheme
|
||||||
|
.white,
|
||||||
|
Colors.transparent,
|
||||||
|
Colors.transparent,
|
||||||
|
tailCirclesSpace: 1,
|
||||||
),
|
),
|
||||||
),
|
|
||||||
if (widget.showReactionPickerIndicator)
|
|
||||||
Positioned(
|
|
||||||
right: widget.reverse ? null : 4,
|
|
||||||
left: widget.reverse ? 4 : null,
|
|
||||||
top: -8,
|
|
||||||
child: CustomPaint(
|
|
||||||
painter: ReactionBubblePainter(
|
|
||||||
StreamChatTheme.of(context)
|
|
||||||
.colorTheme
|
|
||||||
.white,
|
|
||||||
Colors.transparent,
|
|
||||||
Colors.transparent,
|
|
||||||
tailCirclesSpace: 1,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
if (showBottomRow)
|
||||||
if (showBottomRow)
|
SizedBox(height: context.textScaleFactor * 18.0),
|
||||||
SizedBox(height: context.textScaleFactor * 18.0),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
if (showBottomRow)
|
if (showBottomRow)
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(left: leftPadding),
|
padding: EdgeInsets.only(
|
||||||
|
left: leftPadding,
|
||||||
|
bottom:
|
||||||
|
isPinned && widget.showPinHighlight ? 6.0 : 0.0,
|
||||||
|
),
|
||||||
child: _bottomRow,
|
child: _bottomRow,
|
||||||
),
|
),
|
||||||
if (isFailedState)
|
if (isFailedState)
|
||||||
|
|||||||
Reference in New Issue
Block a user