Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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),
),
),
],
],
),
],
),
);
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
Expand All @@ -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,
),
Expand All @@ -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,
),
Expand All @@ -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,
),
Expand Down Expand Up @@ -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,
),
Expand Down