Skip to content

Commit

Permalink
Merge pull request LikeMindsCommunity#32 from LikeMindsCommunity/rele…
Browse files Browse the repository at this point in the history
…ase/v1.1.3

Release/v1.1.3
  • Loading branch information
AnujLM authored Jan 31, 2024
2 parents 22b9775 + 3793791 commit 87cb873
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 28 deletions.
4 changes: 2 additions & 2 deletions example/lib/utils/tagging/tagging_textfield_ta.dart
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class _LMTextFieldState extends State<LMTextField> {
border: InputBorder.none,
),
onChanged: ((value) {
widget.onChange!(value);
widget.onChange?.call(value);
final int newTagCount = '@'.allMatches(value).length;
final int completeCount = '~'.allMatches(value).length;
if (newTagCount == completeCount) {
Expand All @@ -170,7 +170,6 @@ class _LMTextFieldState extends State<LMTextField> {
return await _getSuggestions(suggestion);
},
keepSuggestionsOnSuggestionSelected: true,

itemBuilder: ((context, opt) {
return Container(
decoration: BoxDecoration(
Expand Down Expand Up @@ -226,6 +225,7 @@ class _LMTextFieldState extends State<LMTextField> {
tagValue = '';
textValue = _controller.value.text;
page = 1;
// FocusScope.of(context).requestFocus(_focusNode);
});
}),
),
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.1.1
version: 1.1.3

environment:
sdk: '>=3.0.0 <4.0.0'
Expand Down
2 changes: 1 addition & 1 deletion lib/packages/expandable_text/expandable_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class ExpandableTextState extends State<ExpandableText>
textAlign: textAlign,
textDirection: textDirection,
textScaleFactor: textScaleFactor,
maxLines: 3,
maxLines: widget.maxLines,
locale: locale,
);
textPainter.layout(minWidth: constraints.minWidth, maxWidth: maxWidth);
Expand Down
10 changes: 5 additions & 5 deletions lib/src/utils/helpers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ class TaggingHelper {
RegExp(notificationTagRoute).allMatches(text);
List<UserTag> userTags = [];
for (final match in matches) {
final String tag = match.group(1)!;
final String mid = match.group(2)!;
final String id = match.group(3)!;
final String? tag = match.group(1);
final String? mid = match.group(2);
final String? id = match.group(3);
text = text.replaceAll(
'<<$tag|route://$mid/$id>>', withTilde ? '@$tag~' : '@$tag');
userTags.add(UserTag(userUniqueId: id, name: tag));
Expand All @@ -147,8 +147,8 @@ class TaggingHelper {
List<UserTag> userTags = [];
for (final match in matches) {
final String tag = match.group(1)!;
final String mid = match.group(2)!;
final String id = match.group(3)!;
final String? mid = match.group(2);
final String? id = match.group(3);
userTags.add(UserTag(userUniqueId: id, name: tag));
}
return userTags;
Expand Down
59 changes: 41 additions & 18 deletions lib/src/widgets/conversation/chat_bubble.dart
Original file line number Diff line number Diff line change
Expand Up @@ -309,25 +309,48 @@ class _LMChatBubbleState extends State<LMChatBubble> {
),
),
)
: Padding(
padding: EdgeInsets.only(
top: widget.mediaWidget != null ? 4.0 : 0),
child: widget.content ??
LMChatContent(
conversation: widget.conversation,
linkStyle: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 14,
fontWeight: FontWeight.w400,
),
textStyle: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.w400,
: widget.mediaWidget != null
? Align(
alignment: Alignment.centerLeft,
child: Padding(
padding: EdgeInsets.only(
top: widget.mediaWidget != null ? 4.0 : 0),
child: widget.content ??
LMChatContent(
conversation: widget.conversation,
linkStyle: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 14,
fontWeight: FontWeight.w400,
),
textStyle: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.w400,
),
visibleLines: 4,
animation: true,
),
visibleLines: 4,
animation: true,
),
),
),
)
: Padding(
padding: EdgeInsets.only(
top: widget.mediaWidget != null ? 4.0 : 0),
child: widget.content ??
LMChatContent(
conversation: widget.conversation,
linkStyle: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 14,
fontWeight: FontWeight.w400,
),
textStyle: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.w400,
),
visibleLines: 4,
animation: true,
),
),
if (widget.footer != null && widget.footer!.isNotEmpty && !isDeleted)
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: likeminds_chat_ui_fl
description: A new Flutter package project.
version: 1.1.2
version: 1.1.3
publish_to: none

environment:
Expand Down

0 comments on commit 87cb873

Please sign in to comment.