From 1b9fda947e47d3f0421118ba9852f0147aa09f55 Mon Sep 17 00:00:00 2001 From: Rene Floor Date: Thu, 12 Mar 2026 16:59:31 +0100 Subject: [PATCH] make trailing in reply more flexible --- .../message_composer_attachment_reply.dart | 9 ++++++++- .../message_composer_reply_attachment.dart | 15 +++------------ 2 files changed, 11 insertions(+), 13 deletions(-) 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 47bfc95..69e59fa 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 @@ -27,7 +27,14 @@ Widget buildMessageComposerAttachmentReplyPlayground(BuildContext context) { child: MessageComposerReplyAttachment( 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'), + trailing: Container( + width: 40, + height: 40, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(context.streamRadius.md), + image: const DecorationImage(image: AssetImage('assets/attachment_image.png'), fit: BoxFit.cover), + ), + ), 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 354a833..14c6d7e 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 @@ -8,14 +8,14 @@ class MessageComposerReplyAttachment extends StatelessWidget { super.key, required this.title, required this.subtitle, - this.image, + this.trailing, this.onRemovePressed, this.style = ReplyStyle.incoming, }); final Widget title; final Widget subtitle; - final ImageProvider? image; + final Widget? trailing; final VoidCallback? onRemovePressed; final ReplyStyle style; @@ -61,16 +61,7 @@ class MessageComposerReplyAttachment extends StatelessWidget { ], ), ), - if (image != null) ...[ - Container( - width: 40, - height: 40, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(context.streamRadius.md), - image: DecorationImage(image: image!, fit: BoxFit.cover), - ), - ), - ], + ?trailing, ], ), );