Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] #637083 - Title Toggle added in Chat Preview Attachment page. #259

Merged
merged 2 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
41 changes: 30 additions & 11 deletions lib/src/widgets/chat/video/ds_video_message_bubble.widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import '../../../themes/icons/ds_icons.dart';
import '../../../utils/ds_utils.util.dart';
import '../../animations/ds_uploading.widget.dart';
import '../../buttons/ds_button.widget.dart';
import '../../texts/ds_caption_text.widget.dart';
import '../../utils/ds_circular_progress.widget.dart';
import '../ds_message_bubble.widget.dart';
import '../ds_show_more_text.widget.dart';
Expand Down Expand Up @@ -57,6 +58,9 @@ class DSVideoMessageBubble extends StatefulWidget {
// reply id message
final DSReplyContent? replyContent;

// Video title, shoud the user want it to be sent.
adrianoct42 marked this conversation as resolved.
Show resolved Hide resolved
final String? title;

/// Card for the purpose of triggering a video to play.
///
/// This widget is intended to display a video card from a url passed in the [url] parameter.
Expand All @@ -76,6 +80,7 @@ class DSVideoMessageBubble extends StatefulWidget {
DSMessageBubbleStyle? style,
this.isUploading = false,
this.replyContent,
this.title,
}) : style = style ?? DSMessageBubbleStyle();

@override
Expand Down Expand Up @@ -226,19 +231,33 @@ class _DSVideoMessageBubbleState extends State<DSVideoMessageBubble>
)
: _buidErrorIcon(),
),
if (widget.text?.isNotEmpty ?? false)
if ((widget.title?.isNotEmpty ?? false) ||
adrianoct42 marked this conversation as resolved.
Show resolved Hide resolved
(widget.text?.isNotEmpty ?? false))
SizedBox(
width: DSUtils.bubbleMinSize,
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 8.0,
horizontal: 16.0,
),
child: DSShowMoreText(
text: widget.text!,
align: widget.align,
style: widget.style,
maxWidth: constraints.maxWidth,
padding: const EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (widget.title?.isNotEmpty ?? false)
DSCaptionText(
widget.title!,
color: foregroundColor,
isSelectable: true,
),
if ((widget.text?.isNotEmpty ?? false) &&
(widget.title?.isNotEmpty ?? false))
const SizedBox(
height: 6.0,
),
if (widget.text?.isNotEmpty ?? false)
DSShowMoreText(
text: widget.text!,
align: widget.align,
style: widget.style,
maxWidth: constraints.maxWidth,
)
],
),
),
),
Expand Down
1 change: 1 addition & 0 deletions lib/src/widgets/utils/ds_card.widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ class DSCard extends StatelessWidget {
? avatarConfig.receivedAvatar
: avatarConfig.sentAvatar,
text: media.text,
title: media.title,
replyContent: replyContent,
borderRadius: borderRadius,
style: style,
Expand Down