File tree Expand file tree Collapse file tree 5 files changed +21
-3
lines changed
Expand file tree Collapse file tree 5 files changed +21
-3
lines changed Original file line number Diff line number Diff line change 11## [ 3.0.0]
22
3+ * ** Fix** : [ 415] ( https://github.com/SimformSolutionsPvtLtd/chatview/pull/415 )
4+ Adjust emoji display logic to handle multiple emojis display width and added
5+ ` maxOutSideBubbleEmojis ` parameter in ` EmojiMessageConfig ` .
36* ** Fix** : [ 358] ( https://github.com/SimformSolutionsPvtLtd/chatview/issues/358 ) Fix issue of Image
47 selected from the locally is unable to display in message (windows).
58* ** Feat** : [ 414] ( https://github.com/SimformSolutionsPvtLtd/chatview/pull/414 )
Original file line number Diff line number Diff line change @@ -844,6 +844,9 @@ class _ExampleOneChatScreenState extends State<ExampleOneChatScreen> {
844844 }
845845 return const SizedBox .shrink ();
846846 },
847+ emojiMessageConfig: const EmojiMessageConfiguration (
848+ maxOutSideBubbleEmojis: 1 ,
849+ ),
847850 ),
848851 profileCircleConfig: const ProfileCircleConfiguration (
849852 padding: EdgeInsets .only (right: 4 ),
Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ extension ValidateString on String {
125125 final regex = _urlRegex.allMatches (this );
126126 final urls = < String > [];
127127 for (final match in regex) {
128- if (match.group (0 ) case final url? ) {
128+ if (match.group (0 ) case final url? when url.isUrl ) {
129129 urls.add (url);
130130 }
131131 }
Original file line number Diff line number Diff line change @@ -25,11 +25,16 @@ class EmojiMessageConfiguration {
2525 const EmojiMessageConfiguration ({
2626 this .padding,
2727 this .textStyle,
28+ this .maxOutSideBubbleEmojis,
2829 });
2930
3031 /// Used for giving padding to emoji messages.
3132 final EdgeInsetsGeometry ? padding;
3233
3334 /// Used for giving text style to emoji messages.
3435 final TextStyle ? textStyle;
36+
37+ /// Maximum number of emojis to show outside the bubble
38+ /// for emoji-only messages.
39+ final int ? maxOutSideBubbleEmojis;
3540}
Original file line number Diff line number Diff line change @@ -161,6 +161,8 @@ class _MessageViewState extends State<MessageView>
161161 Widget get _messageView {
162162 final message = widget.message.message;
163163 final emojiMessageConfiguration = messageConfig? .emojiMessageConfig;
164+ final maxOutSideBubbleEmojis =
165+ emojiMessageConfiguration? .maxOutSideBubbleEmojis;
164166 return Padding (
165167 padding: EdgeInsets .only (
166168 bottom: widget.message.reaction.reactions.isNotEmpty ? 6 : 0 ,
@@ -169,11 +171,13 @@ class _MessageViewState extends State<MessageView>
169171 crossAxisAlignment: CrossAxisAlignment .end,
170172 children: [
171173 (() {
172- if (message.isAllEmoji) {
174+ if (message.isAllEmoji &&
175+ (maxOutSideBubbleEmojis == null ||
176+ message.characters.length <= maxOutSideBubbleEmojis)) {
173177 return Stack (
174178 clipBehavior: Clip .none,
175179 children: [
176- Padding (
180+ Container (
177181 padding: emojiMessageConfiguration? .padding ??
178182 EdgeInsets .fromLTRB (
179183 leftPadding2,
@@ -183,6 +187,9 @@ class _MessageViewState extends State<MessageView>
183187 ? 14
184188 : 0 ,
185189 ),
190+ constraints: BoxConstraints (
191+ maxWidth: widget.chatBubbleMaxWidth ??
192+ MediaQuery .sizeOf (context).width * 0.75 ),
186193 child: Transform .scale (
187194 scale: widget.shouldHighlight
188195 ? widget.highlightScale
You can’t perform that action at this time.
0 commit comments