rfac: Removed basic transforms and adjusted borders
This commit is contained in:
@@ -31,42 +31,34 @@ class DeletedMessage extends StatelessWidget {
|
|||||||
final bool reverse;
|
final bool reverse;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => Transform(
|
Widget build(BuildContext context) => Material(
|
||||||
transform: Matrix4.rotationY(reverse ? pi : 0),
|
color: messageTheme.messageBackgroundColor,
|
||||||
alignment: Alignment.center,
|
shape: shape ??
|
||||||
child: Material(
|
RoundedRectangleBorder(
|
||||||
color: messageTheme.messageBackgroundColor,
|
borderRadius: borderRadiusGeometry ?? BorderRadius.zero,
|
||||||
shape: shape ??
|
side: borderSide ??
|
||||||
RoundedRectangleBorder(
|
BorderSide(
|
||||||
borderRadius: borderRadiusGeometry ?? BorderRadius.zero,
|
color: Theme.of(context).brightness == Brightness.dark
|
||||||
side: borderSide ??
|
? StreamChatTheme.of(context)
|
||||||
BorderSide(
|
.colorTheme
|
||||||
color: Theme.of(context).brightness == Brightness.dark
|
.white
|
||||||
? StreamChatTheme.of(context)
|
.withAlpha(24)
|
||||||
.colorTheme
|
: StreamChatTheme.of(context)
|
||||||
.white
|
.colorTheme
|
||||||
.withAlpha(24)
|
.black
|
||||||
: StreamChatTheme.of(context)
|
.withAlpha(24),
|
||||||
.colorTheme
|
),
|
||||||
.black
|
|
||||||
.withAlpha(24),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
vertical: 8,
|
|
||||||
horizontal: 16,
|
|
||||||
),
|
),
|
||||||
child: Transform(
|
child: Padding(
|
||||||
transform: Matrix4.rotationY(reverse ? pi : 0),
|
padding: const EdgeInsets.symmetric(
|
||||||
alignment: Alignment.center,
|
vertical: 8,
|
||||||
child: Text(
|
horizontal: 16,
|
||||||
'Message deleted',
|
),
|
||||||
style: messageTheme.messageText?.copyWith(
|
child: Text(
|
||||||
fontStyle: FontStyle.italic,
|
'Message deleted',
|
||||||
color: messageTheme.createdAt?.color,
|
style: messageTheme.messageText?.copyWith(
|
||||||
),
|
fontStyle: FontStyle.italic,
|
||||||
),
|
color: messageTheme.createdAt?.color,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1000,13 +1000,23 @@ class _MessageListViewState extends State<MessageListView> {
|
|||||||
attachmentPadding: EdgeInsets.all(hasFileAttachment ? 4 : 2),
|
attachmentPadding: EdgeInsets.all(hasFileAttachment ? 4 : 2),
|
||||||
borderRadiusGeometry: BorderRadius.only(
|
borderRadiusGeometry: BorderRadius.only(
|
||||||
topLeft: const Radius.circular(16),
|
topLeft: const Radius.circular(16),
|
||||||
bottomLeft: Radius.circular(
|
bottomLeft: isMyMessage
|
||||||
(timeDiff >= 1 || !isNextUserSame) && !(hasReplies || isThreadMessage)
|
? const Radius.circular(16)
|
||||||
? 0
|
: Radius.circular(
|
||||||
: 16,
|
(timeDiff >= 1 || !isNextUserSame) &&
|
||||||
),
|
!(hasReplies || isThreadMessage)
|
||||||
|
? 0
|
||||||
|
: 16,
|
||||||
|
),
|
||||||
topRight: const Radius.circular(16),
|
topRight: const Radius.circular(16),
|
||||||
bottomRight: const Radius.circular(16),
|
bottomRight: isMyMessage
|
||||||
|
? Radius.circular(
|
||||||
|
(timeDiff >= 1 || !isNextUserSame) &&
|
||||||
|
!(hasReplies || isThreadMessage)
|
||||||
|
? 0
|
||||||
|
: 16,
|
||||||
|
)
|
||||||
|
: const Radius.circular(16),
|
||||||
),
|
),
|
||||||
textPadding: EdgeInsets.symmetric(
|
textPadding: EdgeInsets.symmetric(
|
||||||
vertical: 8,
|
vertical: 8,
|
||||||
|
|||||||
@@ -465,184 +465,166 @@ class _MessageWidgetState extends State<MessageWidget>
|
|||||||
: () => onLongPress(context),
|
: () => onLongPress(context),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: widget.padding ?? const EdgeInsets.all(8),
|
padding: widget.padding ?? const EdgeInsets.all(8),
|
||||||
child: Transform(
|
child: FractionallySizedBox(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.centerLeft,
|
||||||
transform: Matrix4.rotationY(widget.reverse ? pi : 0),
|
widthFactor: 0.78,
|
||||||
child: FractionallySizedBox(
|
child: Column(
|
||||||
alignment: Alignment.centerLeft,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
widthFactor: 0.78,
|
mainAxisSize: MainAxisSize.min,
|
||||||
child: Column(
|
children: <Widget>[
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
Stack(
|
||||||
mainAxisSize: MainAxisSize.min,
|
clipBehavior: Clip.none,
|
||||||
children: <Widget>[
|
alignment: AlignmentDirectional.bottomStart,
|
||||||
Stack(
|
children: [
|
||||||
clipBehavior: Clip.none,
|
Column(
|
||||||
alignment: AlignmentDirectional.bottomStart,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
mainAxisSize: MainAxisSize.min,
|
||||||
Column(
|
children: [
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
children: [
|
mainAxisSize: MainAxisSize.min,
|
||||||
Row(
|
children: <Widget>[
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
if (widget.showUserAvatar == DisplayWidget.show &&
|
||||||
mainAxisSize: MainAxisSize.min,
|
widget.message.user != null) ...[
|
||||||
children: <Widget>[
|
_buildUserAvatar(),
|
||||||
if (widget.showUserAvatar ==
|
const SizedBox(width: 4),
|
||||||
DisplayWidget.show &&
|
],
|
||||||
widget.message.user != null) ...[
|
if (widget.showUserAvatar == DisplayWidget.hide)
|
||||||
_buildUserAvatar(),
|
SizedBox(width: avatarWidth + 4),
|
||||||
const SizedBox(width: 4),
|
Flexible(
|
||||||
],
|
child: PortalEntry(
|
||||||
if (widget.showUserAvatar == DisplayWidget.hide)
|
portal: Container(
|
||||||
SizedBox(width: avatarWidth + 4),
|
transform:
|
||||||
Flexible(
|
Matrix4.translationValues(-12, 0, 0),
|
||||||
child: PortalEntry(
|
constraints: const BoxConstraints(
|
||||||
portal: Container(
|
maxWidth: 22 * 6.0),
|
||||||
transform:
|
child: _buildReactionIndicator(context),
|
||||||
Matrix4.translationValues(-12, 0, 0),
|
),
|
||||||
constraints: const BoxConstraints(
|
portalAnchor: const Alignment(-1, -1),
|
||||||
maxWidth: 22 * 6.0),
|
childAnchor: const Alignment(1, -1),
|
||||||
child: _buildReactionIndicator(context),
|
child: Stack(
|
||||||
),
|
clipBehavior: Clip.none,
|
||||||
portalAnchor: const Alignment(-1, -1),
|
children: [
|
||||||
childAnchor: const Alignment(1, -1),
|
Padding(
|
||||||
child: Stack(
|
padding: widget.showReactions
|
||||||
clipBehavior: Clip.none,
|
? EdgeInsets.only(
|
||||||
children: [
|
top: widget
|
||||||
Padding(
|
.message
|
||||||
padding: widget.showReactions
|
.reactionCounts
|
||||||
? EdgeInsets.only(
|
?.isNotEmpty ==
|
||||||
top: widget
|
true
|
||||||
.message
|
? 18
|
||||||
.reactionCounts
|
: 0,
|
||||||
?.isNotEmpty ==
|
)
|
||||||
true
|
: EdgeInsets.zero,
|
||||||
? 18
|
child: (widget.message.isDeleted &&
|
||||||
: 0,
|
!isFailedState)
|
||||||
)
|
? Container(
|
||||||
: EdgeInsets.zero,
|
// ignore: lines_longer_than_80_chars
|
||||||
child: (widget.message.isDeleted &&
|
margin: EdgeInsets.symmetric(
|
||||||
!isFailedState)
|
horizontal:
|
||||||
? Transform(
|
|
||||||
alignment: Alignment.center,
|
|
||||||
transform: Matrix4.rotationY(
|
|
||||||
widget.reverse ? pi : 0),
|
|
||||||
child: 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(
|
|
||||||
reverse: widget.reverse,
|
|
||||||
// ignore: lines_longer_than_80_chars
|
|
||||||
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(
|
||||||
shape: widget.shape ??
|
borderRadiusGeometry: widget
|
||||||
RoundedRectangleBorder(
|
.borderRadiusGeometry,
|
||||||
side: widget
|
borderSide: widget.borderSide,
|
||||||
.borderSide ??
|
shape: widget.shape,
|
||||||
BorderSide(
|
messageTheme:
|
||||||
color: widget
|
widget.messageTheme,
|
||||||
// ignore: lines_longer_than_80_chars
|
|
||||||
.messageTheme
|
|
||||||
// ignore: lines_longer_than_80_chars
|
|
||||||
.messageBorderColor ??
|
|
||||||
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)
|
: Card(
|
||||||
Positioned(
|
clipBehavior: Clip.antiAlias,
|
||||||
right: 4,
|
elevation: 0,
|
||||||
top: -8,
|
margin: EdgeInsets.symmetric(
|
||||||
child: Transform(
|
horizontal: (isFailedState
|
||||||
transform: Matrix4.rotationY(
|
? 15.0
|
||||||
widget.reverse ? pi : 0),
|
: 0.0) +
|
||||||
child: CustomPaint(
|
// ignore: lines_longer_than_80_chars
|
||||||
painter: ReactionBubblePainter(
|
(widget.showUserAvatar ==
|
||||||
StreamChatTheme.of(context)
|
DisplayWidget.gone
|
||||||
.colorTheme
|
? 0
|
||||||
.white,
|
: 4.0),
|
||||||
Colors.transparent,
|
),
|
||||||
Colors.transparent,
|
shape: widget.shape ??
|
||||||
tailCirclesSpace: 1,
|
RoundedRectangleBorder(
|
||||||
|
side: widget.borderSide ??
|
||||||
|
BorderSide(
|
||||||
|
color: widget
|
||||||
|
// ignore: lines_longer_than_80_chars
|
||||||
|
.messageTheme
|
||||||
|
// ignore: lines_longer_than_80_chars
|
||||||
|
.messageBorderColor ??
|
||||||
|
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: 4,
|
||||||
|
top: -8,
|
||||||
|
child: CustomPaint(
|
||||||
|
painter: ReactionBubblePainter(
|
||||||
|
StreamChatTheme.of(context)
|
||||||
|
.colorTheme
|
||||||
|
.white,
|
||||||
|
Colors.transparent,
|
||||||
|
Colors.transparent,
|
||||||
|
tailCirclesSpace: 1,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
if (showBottomRow)
|
),
|
||||||
SizedBox(height: context.textScaleFactor * 18.0),
|
if (showBottomRow)
|
||||||
],
|
SizedBox(height: context.textScaleFactor * 18.0),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
if (showBottomRow)
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(left: leftPadding),
|
||||||
|
child: _bottomRow,
|
||||||
),
|
),
|
||||||
if (showBottomRow)
|
if (isFailedState)
|
||||||
Padding(
|
Positioned(
|
||||||
padding: EdgeInsets.only(left: leftPadding),
|
left: widget.reverse ? 0 : null,
|
||||||
child: _bottomRow,
|
right: widget.reverse ? null : 0,
|
||||||
),
|
bottom: showBottomRow ? 18 : -2,
|
||||||
if (isFailedState)
|
child: StreamSvgIcon.error(size: 20),
|
||||||
Positioned(
|
),
|
||||||
left: widget.reverse ? 0 : null,
|
],
|
||||||
right: widget.reverse ? null : 0,
|
),
|
||||||
bottom: showBottomRow ? 18 : -2,
|
],
|
||||||
child: StreamSvgIcon.error(size: 20),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -672,26 +654,22 @@ class _MessageWidgetState extends State<MessageWidget>
|
|||||||
|
|
||||||
Widget get _bottomRow {
|
Widget get _bottomRow {
|
||||||
if (isDeleted) {
|
if (isDeleted) {
|
||||||
return Transform(
|
return Row(
|
||||||
transform: Matrix4.rotationY(widget.reverse ? pi : 0),
|
mainAxisSize: MainAxisSize.min,
|
||||||
alignment: Alignment.center,
|
children: [
|
||||||
child: Row(
|
StreamSvgIcon.eye(
|
||||||
mainAxisSize: MainAxisSize.min,
|
color: StreamChatTheme.of(context).colorTheme.grey,
|
||||||
children: [
|
size: 16,
|
||||||
StreamSvgIcon.eye(
|
),
|
||||||
color: StreamChatTheme.of(context).colorTheme.grey,
|
const SizedBox(width: 8),
|
||||||
size: 16,
|
Text(
|
||||||
),
|
'Only visible to you',
|
||||||
const SizedBox(width: 8),
|
style: StreamChatTheme.of(context)
|
||||||
Text(
|
.textTheme
|
||||||
'Only visible to you',
|
.footnote
|
||||||
style: StreamChatTheme.of(context)
|
.copyWith(color: StreamChatTheme.of(context).colorTheme.grey),
|
||||||
.textTheme
|
),
|
||||||
.footnote
|
],
|
||||||
.copyWith(color: StreamChatTheme.of(context).colorTheme.grey),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -775,13 +753,9 @@ class _MessageWidgetState extends State<MessageWidget>
|
|||||||
),
|
),
|
||||||
...children.map(
|
...children.map(
|
||||||
(child) {
|
(child) {
|
||||||
Widget mappedChild = Transform(
|
Widget mappedChild = SizedBox(
|
||||||
transform: Matrix4.rotationY(widget.reverse ? pi : 0),
|
height: context.textScaleFactor * 14,
|
||||||
alignment: Alignment.center,
|
child: child,
|
||||||
child: SizedBox(
|
|
||||||
height: context.textScaleFactor * 14,
|
|
||||||
child: child,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
if (child.key == usernameKey) {
|
if (child.key == usernameKey) {
|
||||||
mappedChild = Flexible(child: mappedChild);
|
mappedChild = Flexible(child: mappedChild);
|
||||||
@@ -1071,56 +1045,47 @@ class _MessageWidgetState extends State<MessageWidget>
|
|||||||
return child;
|
return child;
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildUserAvatar() => Transform(
|
Widget _buildUserAvatar() => Transform.translate(
|
||||||
transform: Matrix4.rotationY(widget.reverse ? pi : 0),
|
offset: Offset(
|
||||||
alignment: Alignment.center,
|
0,
|
||||||
child: Transform.translate(
|
widget.translateUserAvatar
|
||||||
offset: Offset(
|
? (widget.messageTheme.avatarTheme?.constraints.maxHeight ?? 40) /
|
||||||
0,
|
2
|
||||||
widget.translateUserAvatar
|
: 0,
|
||||||
? (widget.messageTheme.avatarTheme?.constraints.maxHeight ??
|
),
|
||||||
40) /
|
child: UserAvatar(
|
||||||
2
|
user: widget.message.user!,
|
||||||
: 0,
|
onTap: widget.onUserAvatarTap,
|
||||||
),
|
constraints: widget.messageTheme.avatarTheme!.constraints,
|
||||||
child: UserAvatar(
|
borderRadius: widget.messageTheme.avatarTheme!.borderRadius,
|
||||||
user: widget.message.user!,
|
showOnlineStatus: false,
|
||||||
onTap: widget.onUserAvatarTap,
|
|
||||||
constraints: widget.messageTheme.avatarTheme!.constraints,
|
|
||||||
borderRadius: widget.messageTheme.avatarTheme!.borderRadius,
|
|
||||||
showOnlineStatus: false,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
Widget _buildTextBubble() {
|
Widget _buildTextBubble() {
|
||||||
if (widget.message.text!.trim().isEmpty) return const Offstage();
|
if (widget.message.text!.trim().isEmpty) return const Offstage();
|
||||||
return Transform(
|
return Column(
|
||||||
transform: Matrix4.rotationY(widget.reverse ? pi : 0),
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
alignment: Alignment.center,
|
children: [
|
||||||
child: Column(
|
Padding(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
padding: isOnlyEmoji ? EdgeInsets.zero : widget.textPadding,
|
||||||
children: [
|
child: widget.textBuilder != null
|
||||||
Padding(
|
? widget.textBuilder!(context, widget.message)
|
||||||
padding: isOnlyEmoji ? EdgeInsets.zero : widget.textPadding,
|
: MessageText(
|
||||||
child: widget.textBuilder != null
|
onLinkTap: widget.onLinkTap,
|
||||||
? widget.textBuilder!(context, widget.message)
|
message: widget.message,
|
||||||
: MessageText(
|
onMentionTap: widget.onMentionTap,
|
||||||
onLinkTap: widget.onLinkTap,
|
messageTheme: isOnlyEmoji
|
||||||
message: widget.message,
|
? widget.messageTheme.copyWith(
|
||||||
onMentionTap: widget.onMentionTap,
|
messageText:
|
||||||
messageTheme: isOnlyEmoji
|
widget.messageTheme.messageText!.copyWith(
|
||||||
? widget.messageTheme.copyWith(
|
fontSize: 42,
|
||||||
messageText:
|
))
|
||||||
widget.messageTheme.messageText!.copyWith(
|
: widget.messageTheme,
|
||||||
fontSize: 42,
|
),
|
||||||
))
|
),
|
||||||
: widget.messageTheme,
|
if (hasUrlAttachments && !hasQuotedMessage) _buildUrlAttachment(),
|
||||||
),
|
],
|
||||||
),
|
|
||||||
if (hasUrlAttachments && !hasQuotedMessage) _buildUrlAttachment(),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -133,21 +133,17 @@ class QuotedMessageWidget extends StatelessWidget {
|
|||||||
if (_hasAttachments) _parseAttachments(context),
|
if (_hasAttachments) _parseAttachments(context),
|
||||||
if (msg.text!.isNotEmpty)
|
if (msg.text!.isNotEmpty)
|
||||||
Flexible(
|
Flexible(
|
||||||
child: Transform(
|
child: MessageText(
|
||||||
transform: Matrix4.rotationY(reverse ? pi : 0),
|
message: msg,
|
||||||
alignment: Alignment.center,
|
messageTheme: isOnlyEmoji && _containsText
|
||||||
child: MessageText(
|
? messageTheme.copyWith(
|
||||||
message: msg,
|
messageText: messageTheme.messageText?.copyWith(
|
||||||
messageTheme: isOnlyEmoji && _containsText
|
fontSize: 32,
|
||||||
? messageTheme.copyWith(
|
))
|
||||||
messageText: messageTheme.messageText?.copyWith(
|
: messageTheme.copyWith(
|
||||||
fontSize: 32,
|
messageText: messageTheme.messageText?.copyWith(
|
||||||
))
|
fontSize: 12,
|
||||||
: messageTheme.copyWith(
|
)),
|
||||||
messageText: messageTheme.messageText?.copyWith(
|
|
||||||
fontSize: 12,
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
].insertBetween(const SizedBox(width: 8));
|
].insertBetween(const SizedBox(width: 8));
|
||||||
@@ -218,15 +214,11 @@ class QuotedMessageWidget extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
child = AbsorbPointer(child: child);
|
child = AbsorbPointer(child: child);
|
||||||
return Transform(
|
return Material(
|
||||||
transform: Matrix4.rotationY(reverse ? pi : 0),
|
clipBehavior: Clip.antiAlias,
|
||||||
alignment: Alignment.center,
|
type: MaterialType.transparency,
|
||||||
child: Material(
|
shape: attachment.type == 'file' ? null : _getDefaultShape(context),
|
||||||
clipBehavior: Clip.antiAlias,
|
child: child,
|
||||||
type: MaterialType.transparency,
|
|
||||||
shape: attachment.type == 'file' ? null : _getDefaultShape(context),
|
|
||||||
child: child,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -235,17 +227,13 @@ class QuotedMessageWidget extends StatelessWidget {
|
|||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
);
|
);
|
||||||
|
|
||||||
Widget _buildUserAvatar() => Transform(
|
Widget _buildUserAvatar() => UserAvatar(
|
||||||
transform: Matrix4.rotationY(reverse ? pi : 0),
|
user: message.user!,
|
||||||
alignment: Alignment.center,
|
constraints: const BoxConstraints.tightFor(
|
||||||
child: UserAvatar(
|
height: 24,
|
||||||
user: message.user!,
|
width: 24,
|
||||||
constraints: const BoxConstraints.tightFor(
|
|
||||||
height: 24,
|
|
||||||
width: 24,
|
|
||||||
),
|
|
||||||
showOnlineStatus: false,
|
|
||||||
),
|
),
|
||||||
|
showOnlineStatus: false,
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, QuotedMessageAttachmentThumbnailBuilder>
|
Map<String, QuotedMessageAttachmentThumbnailBuilder>
|
||||||
|
|||||||
@@ -52,68 +52,64 @@ class ReactionBubble extends StatelessWidget {
|
|||||||
final reactionIcons = StreamChatTheme.of(context).reactionIcons;
|
final reactionIcons = StreamChatTheme.of(context).reactionIcons;
|
||||||
final totalReactions = reactions.length;
|
final totalReactions = reactions.length;
|
||||||
final offset = totalReactions > 1 ? 16.0 : 2.0;
|
final offset = totalReactions > 1 ? 16.0 : 2.0;
|
||||||
return Transform(
|
return Stack(
|
||||||
transform: Matrix4.rotationY(reverse ? pi : 0),
|
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: Stack(
|
children: [
|
||||||
alignment: Alignment.center,
|
Transform.translate(
|
||||||
children: [
|
offset: Offset(reverse ? offset : -offset, 0),
|
||||||
Transform.translate(
|
child: Container(
|
||||||
offset: Offset(reverse ? offset : -offset, 0),
|
padding: const EdgeInsets.all(2),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: maskColor,
|
||||||
|
borderRadius: const BorderRadius.all(Radius.circular(16)),
|
||||||
|
),
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(2),
|
padding: EdgeInsets.symmetric(
|
||||||
decoration: BoxDecoration(
|
vertical: 4,
|
||||||
color: maskColor,
|
horizontal: totalReactions > 1 ? 4 : 0,
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(16)),
|
|
||||||
),
|
),
|
||||||
child: Container(
|
decoration: BoxDecoration(
|
||||||
padding: EdgeInsets.symmetric(
|
border: Border.all(
|
||||||
vertical: 4,
|
color: borderColor,
|
||||||
horizontal: totalReactions > 1 ? 4 : 0,
|
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
color: backgroundColor,
|
||||||
border: Border.all(
|
borderRadius: const BorderRadius.all(Radius.circular(14)),
|
||||||
color: borderColor,
|
),
|
||||||
),
|
child: LayoutBuilder(
|
||||||
color: backgroundColor,
|
builder: (context, constraints) => Flex(
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(14)),
|
direction: Axis.horizontal,
|
||||||
),
|
mainAxisSize: MainAxisSize.min,
|
||||||
child: LayoutBuilder(
|
children: [
|
||||||
builder: (context, constraints) => Flex(
|
if (constraints.maxWidth < double.infinity)
|
||||||
direction: Axis.horizontal,
|
...reactions
|
||||||
mainAxisSize: MainAxisSize.min,
|
.take((constraints.maxWidth) ~/ 24)
|
||||||
children: [
|
.map((reaction) => _buildReaction(
|
||||||
if (constraints.maxWidth < double.infinity)
|
reactionIcons,
|
||||||
...reactions
|
reaction,
|
||||||
.take((constraints.maxWidth) ~/ 24)
|
context,
|
||||||
.map((reaction) => _buildReaction(
|
))
|
||||||
reactionIcons,
|
.toList(),
|
||||||
reaction,
|
if (constraints.maxWidth == double.infinity)
|
||||||
context,
|
...reactions
|
||||||
))
|
.map((reaction) => _buildReaction(
|
||||||
.toList(),
|
reactionIcons,
|
||||||
if (constraints.maxWidth == double.infinity)
|
reaction,
|
||||||
...reactions
|
context,
|
||||||
.map((reaction) => _buildReaction(
|
))
|
||||||
reactionIcons,
|
.toList(),
|
||||||
reaction,
|
],
|
||||||
context,
|
|
||||||
))
|
|
||||||
.toList(),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Positioned(
|
),
|
||||||
bottom: 2,
|
Positioned(
|
||||||
left: reverse ? null : 13,
|
bottom: 2,
|
||||||
right: !reverse ? null : 13,
|
left: reverse ? null : 13,
|
||||||
child: _buildReactionsTail(context),
|
right: !reverse ? null : 13,
|
||||||
),
|
child: _buildReactionsTail(context),
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,11 +162,7 @@ class ReactionBubble extends StatelessWidget {
|
|||||||
tailCirclesSpace: tailCirclesSpacing,
|
tailCirclesSpace: tailCirclesSpacing,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
return Transform(
|
return tail;
|
||||||
transform: Matrix4.rotationY(flipTail ? 0 : pi),
|
|
||||||
alignment: Alignment.center,
|
|
||||||
child: tail,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -347,10 +347,6 @@ Widget wrapAttachmentWidget(
|
|||||||
clipBehavior: Clip.antiAlias,
|
clipBehavior: Clip.antiAlias,
|
||||||
shape: attachmentShape,
|
shape: attachmentShape,
|
||||||
type: MaterialType.transparency,
|
type: MaterialType.transparency,
|
||||||
child: Transform(
|
child: attachmentWidget,
|
||||||
transform: Matrix4.rotationY(reverse ? pi : 0),
|
|
||||||
alignment: Alignment.center,
|
|
||||||
child: attachmentWidget,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user