diff --git a/apps/design_system_gallery/lib/components/message_composer/message_composer_attachment_reply.dart b/apps/design_system_gallery/lib/components/message_composer/message_composer_attachment_reply.dart index 2ea43b0..47bfc95 100644 --- a/apps/design_system_gallery/lib/components/message_composer/message_composer_attachment_reply.dart +++ b/apps/design_system_gallery/lib/components/message_composer/message_composer_attachment_reply.dart @@ -25,8 +25,8 @@ Widget buildMessageComposerAttachmentReplyPlayground(BuildContext context) { child: ConstrainedBox( constraints: const BoxConstraints(maxWidth: 360), child: MessageComposerReplyAttachment( - title: 'Reply to John Doe', - subtitle: 'We had a great time during our holiday.', + title: const Text('Reply to John Doe'), + subtitle: const Text('We had a great time during our holiday.'), image: const AssetImage('assets/attachment_image.png'), onRemovePressed: () {}, style: style, diff --git a/packages/stream_core_flutter/lib/src/components/message_composer/attachment/message_composer_reply_attachment.dart b/packages/stream_core_flutter/lib/src/components/message_composer/attachment/message_composer_reply_attachment.dart index a6d7a31..354a833 100644 --- a/packages/stream_core_flutter/lib/src/components/message_composer/attachment/message_composer_reply_attachment.dart +++ b/packages/stream_core_flutter/lib/src/components/message_composer/attachment/message_composer_reply_attachment.dart @@ -13,8 +13,8 @@ class MessageComposerReplyAttachment extends StatelessWidget { this.style = ReplyStyle.incoming, }); - final String title; - final String subtitle; + final Widget title; + final Widget subtitle; final ImageProvider? image; final VoidCallback? onRemovePressed; final ReplyStyle style; @@ -35,55 +35,43 @@ class MessageComposerReplyAttachment extends StatelessWidget { return StreamMessageComposerAttachmentContainer( onRemovePressed: onRemovePressed, backgroundColor: backgroundColor, - child: IntrinsicHeight( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: const EdgeInsets.only(top: 2, bottom: 2), - color: indicatorColor, - child: const SizedBox( - width: 2, - height: double.infinity, - ), + child: Row( + spacing: spacing.xs, + children: [ + Container( + margin: const EdgeInsets.only(top: 2, bottom: 2), + color: indicatorColor, + child: const SizedBox(width: 2, height: 36), + ), + Expanded( + child: Column( + spacing: spacing.xxxs, + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + DefaultTextStyle.merge( + style: context.streamTextTheme.metadataEmphasis.copyWith(color: textColor), + child: title, + ), + DefaultTextStyle.merge( + style: context.streamTextTheme.metadataDefault.copyWith(color: textColor), + child: subtitle, + ), + ], ), - SizedBox(width: spacing.xs), - Expanded( - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text(title, style: context.streamTextTheme.metadataEmphasis.copyWith(color: textColor)), - Row( - children: [ - if (image != null) ...[ - Icon(context.streamIcons.camera1, size: 12), - SizedBox(width: spacing.xxs), - ], - Expanded( - child: Text( - subtitle, - style: context.streamTextTheme.metadataDefault.copyWith(color: textColor), - ), - ), - ], - ), - ], + ), + if (image != null) ...[ + Container( + width: 40, + height: 40, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(context.streamRadius.md), + image: DecorationImage(image: image!, fit: BoxFit.cover), ), ), - if (image != null) ...[ - SizedBox(width: spacing.xs), - Container( - width: 40, - height: 40, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(context.streamRadius.md), - image: DecorationImage(image: image!, fit: BoxFit.cover), - ), - ), - ], ], - ), + ], ), ); } diff --git a/packages/stream_core_flutter/test/components/message_composer/goldens/ci/message_composer_attachment_reply_custom_matrix.png b/packages/stream_core_flutter/test/components/message_composer/goldens/ci/message_composer_attachment_reply_custom_matrix.png index 0e04c6c..2de7f25 100644 Binary files a/packages/stream_core_flutter/test/components/message_composer/goldens/ci/message_composer_attachment_reply_custom_matrix.png and b/packages/stream_core_flutter/test/components/message_composer/goldens/ci/message_composer_attachment_reply_custom_matrix.png differ diff --git a/packages/stream_core_flutter/test/components/message_composer/goldens/ci/message_composer_attachment_reply_dark_matrix.png b/packages/stream_core_flutter/test/components/message_composer/goldens/ci/message_composer_attachment_reply_dark_matrix.png index faea8dd..8a267cd 100644 Binary files a/packages/stream_core_flutter/test/components/message_composer/goldens/ci/message_composer_attachment_reply_dark_matrix.png and b/packages/stream_core_flutter/test/components/message_composer/goldens/ci/message_composer_attachment_reply_dark_matrix.png differ diff --git a/packages/stream_core_flutter/test/components/message_composer/goldens/ci/message_composer_attachment_reply_light_matrix.png b/packages/stream_core_flutter/test/components/message_composer/goldens/ci/message_composer_attachment_reply_light_matrix.png index 00799be..c7dbbf6 100644 Binary files a/packages/stream_core_flutter/test/components/message_composer/goldens/ci/message_composer_attachment_reply_light_matrix.png and b/packages/stream_core_flutter/test/components/message_composer/goldens/ci/message_composer_attachment_reply_light_matrix.png differ diff --git a/packages/stream_core_flutter/test/components/message_composer/message_composer_attachment_reply_golden_test.dart b/packages/stream_core_flutter/test/components/message_composer/message_composer_attachment_reply_golden_test.dart index 5a76147..ef2044f 100644 --- a/packages/stream_core_flutter/test/components/message_composer/message_composer_attachment_reply_golden_test.dart +++ b/packages/stream_core_flutter/test/components/message_composer/message_composer_attachment_reply_golden_test.dart @@ -18,8 +18,8 @@ void main() { name: '${style.name}_no_remove', child: _buildReplyInTheme( MessageComposerReplyAttachment( - title: 'Reply to John Doe', - subtitle: 'We had a great time during our holiday.', + title: const Text('Reply to John Doe'), + subtitle: const Text('We had a great time during our holiday.'), onRemovePressed: null, style: style, ), @@ -30,8 +30,8 @@ void main() { name: '${style.name}_with_remove', child: _buildReplyInTheme( MessageComposerReplyAttachment( - title: 'Reply to John Doe', - subtitle: 'We had a great time during our holiday.', + title: const Text('Reply to John Doe'), + subtitle: const Text('We had a great time during our holiday.'), onRemovePressed: () {}, style: style, ), @@ -52,8 +52,8 @@ void main() { name: '${style.name}_no_remove', child: _buildReplyInTheme( MessageComposerReplyAttachment( - title: 'Reply to John Doe', - subtitle: 'We had a great time during our holiday.', + title: const Text('Reply to John Doe'), + subtitle: const Text('We had a great time during our holiday.'), onRemovePressed: null, style: style, ), @@ -65,8 +65,8 @@ void main() { name: '${style.name}_with_remove', child: _buildReplyInTheme( MessageComposerReplyAttachment( - title: 'Reply to John Doe', - subtitle: 'We had a great time during our holiday.', + title: const Text('Reply to John Doe'), + subtitle: const Text('We had a great time during our holiday.'), onRemovePressed: () {}, style: style, ), @@ -101,8 +101,8 @@ void main() { ), ), child: MessageComposerReplyAttachment( - title: 'Reply to John Doe', - subtitle: 'We had a great time during our holiday.', + title: const Text('Reply to John Doe'), + subtitle: const Text('We had a great time during our holiday.'), onRemovePressed: null, style: style, ),