Skip to content

Commit d92c095

Browse files
Updated to version - 4.3.3
1 parent a1c86f0 commit d92c095

File tree

11 files changed

+179
-65
lines changed

11 files changed

+179
-65
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## 4.3.3 - 16th April 2024
2+
3+
### Fixes
4+
- Addressed an issue with duplicate messages appearing in CometChatMessageList when a media message was sent.
5+
- Resolved an issue where smart replies did not disappear after sending or receiving messages.
6+
7+
### Enhancements
8+
- Upgraded `cometchat_uikit_shared` to version `4.2.9`
9+
- Upgraded `cometchat_sdk` to version `4.0.8`
10+
111
## 4.3.2 - 9th April 2024
212

313
### Fixes

README.md

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,37 @@
22
<img alt="CometChat" src="https://assets.cometchat.io/website/images/logos/banner.png">
33
</p>
44

5-
# CometChat Flutter UI Kit
5+
# CometChat Flutter Chat UIKit
6+
<a href="https://pub.dev/packages/cometchat_uikit_shared"><strong>CometChat UIKit Shared</strong></a> serves as a foundation for two robust UI Kits - <a href="https://pub.dev/packages/cometchat_chat_uikit"><strong>CometChat Chat UIKit</strong></a> and <a href="https://pub.dev/packages/cometchat_calls_uikit"><strong>CometChat Calls UIKit</strong></a>. The modular design of the resources and widgets provided by this package ensures efficient code reuse and consistent styling across your app. <br/>
7+
This carefully crafted library, built with Dart and Flutter, empowers you with:
8+
#### Pre-built UI Components:
9+
- The message bubbles displayed in `CometChatMessageList` from Chat UI Kit.
10+
- `CometChatListBase` and `CometChatListItem` which is used to construct the list of users, groups and conversations in the Chat UI Kit.
11+
- Status indicator to indicate if an user is online or offline.
12+
- the card and button widgets which are used to construct the incoming and outgoing call screens provided by the Calls UI Kit and much more.
613

7-
CometChat Flutter UIKit provides pre-built user interface kit that developers can use to quickly integrate a reliable & fully featured chat experience into an existing or a new mobile app.<br />
14+
<br/>
15+
16+
#### Extensive Utility Resources:
17+
- Beyond UI components, cometchat_uikit_shared offers a plethora of utility resources. From streamlined setup processes to intricate behind-the-scenes functionalities, it ensures a robust foundation for your application.
18+
- Set up the CometChat SDK seamlessly with built-in functionalities for sending and receiving messages.
19+
20+
<br/>
821

922
### Prerequisites
10-
- Flutter 3.0.5
11-
- Dart 2.17.6
12-
- Android Studio 2021.3 dolphin
13-
- Xcode 14.2
23+
- Flutter 3.10.5
24+
- Dart 3.0.5
25+
- Android Studio 2022.2
26+
- Xcode 14.3
1427
- Android 9, API 28 and above
15-
- iOS 11.0
28+
- iOS 12.0
1629

1730
## Getting Started
18-
To set up Flutter Chat UIKit and utilize CometChat for your chat functionality, you'll need to follow these steps:
19-
20-
1. **Create an Account**: Register at the [CometChat Dashboard](https://app.cometchat.com/) to create an account.
21-
22-
2. **Create an Application**: After registering, log into your CometChat account and create a new app. Once created, CometChat will generate an Auth Key and App ID for you. Keep these credentials secure as you'll need them later.
23-
24-
3. **Check the [Key Concepts](https://www.cometchat.com/docs/v4/flutter-uikit/key-concepts)** to understand the basic components of CometChat.
25-
26-
4. **Refer to the [Integration Steps](https://www.cometchat.com/docs/v4/flutter-uikit/integration#getting-started)** in our documentation to integrate the UI Kit into your Flutter app.
31+
To set up CometChat's Flutter UIKit and utilize CometChat for your chat and calls functionality which internally used this package as a dependency, you'll need to follow these steps:
32+
- Registration: Go to the CometChat website (https://www.cometchat.com/) and sign up for an account.
33+
- Create an App: After registering, log in to your CometChat account and create a new app. Provide the necessary details such as the app name, platform (Flutter), and other relevant information. Once you've created the app, CometChat will generate an Auth Key and App ID for you. Make sure to keep these credentials secure, as you'll need them later.
34+
- Make sure you've read the [key concepts](https://www.cometchat.com/docs/v4/flutter-uikit/key-concepts)
35+
- Follow the steps provided in the integration section [here](https://www.cometchat.com/docs/v4/flutter-uikit/integration#getting-started)
2736

2837
## Help and Support
29-
For issues running the project or integrating with our UI Kits, consult our [documentation](https://www.cometchat.com/docs/react-uikit/integration) or create a [support ticket](https://help.cometchat.com/hc/en-us) or seek real-time support via the [CometChat Dashboard](https://app.cometchat.com/).
30-
31-
38+
For issues running the project or integrating with our UI Kits, consult our [documentation](https://www.cometchat.com/docs/v4/flutter-uikit/integration) or create a [support ticket](https://help.cometchat.com/hc/en-us) or seek real-time support via the [CometChat Dashboard](https://app.cometchat.com/).

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ android {
4646

4747
defaultConfig {
4848
minSdkVersion 21
49-
buildConfigField("String", "SDK_VERSION", "\"4.3.2\"")
49+
buildConfigField("String", "SDK_VERSION", "\"4.3.3\"")
5050
}
5151
}
5252

example/ios/Podfile.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
PODS:
2-
- cometchat_chat_uikit (4.3.2):
2+
- cometchat_chat_uikit (4.3.3):
33
- Flutter
4-
- cometchat_sdk (4.0.7):
5-
- CometChatSDK (= 4.0.43)
4+
- cometchat_sdk (4.0.8):
5+
- CometChatSDK (= 4.0.44)
66
- Flutter
7-
- cometchat_uikit_shared (4.2.8):
7+
- cometchat_uikit_shared (4.2.9):
88
- Flutter
9-
- CometChatSDK (4.0.43)
9+
- CometChatSDK (4.0.44)
1010
- Flutter (1.0.0)
1111
- image_picker_ios (0.0.1):
1212
- Flutter
@@ -71,10 +71,10 @@ EXTERNAL SOURCES:
7171
:path: ".symlinks/plugins/webview_flutter_wkwebview/ios"
7272

7373
SPEC CHECKSUMS:
74-
cometchat_chat_uikit: 36c14bf96ee9d7b0683196b439fe729c9a3b503c
75-
cometchat_sdk: 0fa3c8e0f0219ed6475bc0e793c81a4077c784a0
76-
cometchat_uikit_shared: 7aaabd7e165fd3a9ba4d2c053247a1641714559e
77-
CometChatSDK: aef868cd0190b76c2ce352127e9894b7a4f650b4
74+
cometchat_chat_uikit: a6adede306eadf4d91b28193ce546705dd558e15
75+
cometchat_sdk: 3cfd23c94f93809cc7ca00b17fec2ed25ef9a7a1
76+
cometchat_uikit_shared: 5950fdb8902c7a8fec0e49b4b4ffda3a3603c17b
77+
CometChatSDK: fd757d30972d283623291546f0c58f3e49e50d17
7878
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
7979
image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5
8080
integration_test: 13825b8a9334a850581300559b8839134b124670

example/pubspec.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,23 +63,23 @@ packages:
6363
path: ".."
6464
relative: true
6565
source: path
66-
version: "4.3.2"
66+
version: "4.3.3"
6767
cometchat_sdk:
6868
dependency: transitive
6969
description:
7070
name: cometchat_sdk
71-
sha256: "525067909e507ff4613df4158915b6499015a8d2693090fcec0973790bc30e81"
71+
sha256: feafee8841665ff8db324f763d42abfd2fded010045cc56941b8ba2afabcf19b
7272
url: "https://pub.dev"
7373
source: hosted
74-
version: "4.0.7"
74+
version: "4.0.8"
7575
cometchat_uikit_shared:
7676
dependency: transitive
7777
description:
7878
name: cometchat_uikit_shared
79-
sha256: b0febd296c68073a577445fa69c04d73caec8ff999e0fdd275558dc0a84da44c
79+
sha256: d4490053dcc0c1048db7e0fd09f7c442f2bdd69d7bc2ce70d5db595d34ac0873
8080
url: "https://pub.dev"
8181
source: hosted
82-
version: "4.2.8"
82+
version: "4.2.9"
8383
cross_file:
8484
dependency: transitive
8585
description:

ios/cometchat_chat_uikit.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
Pod::Spec.new do |s|
66
s.name = 'cometchat_chat_uikit'
7-
s.version = '4.3.2'
7+
s.version = '4.3.3'
88
s.summary = 'CometChat Flutter UI KIt'
99
s.description = <<-DESC
1010
CometChat Flutter UI KIt

lib/src/extensions/smart_reply/smart_reply_extension_decorator.dart

Lines changed: 110 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,9 @@ class SmartReplyExtensionDecorator extends DataSourceDecorator
4646
return replies;
4747
}
4848

49-
50-
5149
@override
5250
void ccActiveChatChanged(Map<String, dynamic>? id, BaseMessage? lastMessage,
53-
User? user, Group? group, int unreadMessageCount ) {
51+
User? user, Group? group, int unreadMessageCount) {
5452
if (lastMessage != null &&
5553
lastMessage is TextMessage &&
5654
lastMessage.sender?.uid != loggedInUser?.uid) {
@@ -63,38 +61,130 @@ class SmartReplyExtensionDecorator extends DataSourceDecorator
6361
checkAndShowReplies(textMessage);
6462
}
6563

64+
@override
65+
void onMediaMessageReceived(MediaMessage mediaMessage) {
66+
String? uid;
67+
String? guid;
68+
if (mediaMessage.receiverType == ReceiverTypeConstants.user) {
69+
uid = (mediaMessage.sender as User).uid;
70+
} else {
71+
guid = (mediaMessage.receiver as Group).guid;
72+
}
73+
Map<String, dynamic> id =
74+
UIEventUtils.createMap(uid, guid, mediaMessage.parentMessageId);
75+
76+
CometChatUIEvents.hidePanel(id, CustomUIPosition.messageListBottom);
77+
}
78+
79+
@override
80+
void onCustomMessageReceived(CustomMessage customMessage) {
81+
String? uid;
82+
String? guid;
83+
if (customMessage.receiverType == ReceiverTypeConstants.user) {
84+
uid = (customMessage.sender as User).uid;
85+
} else {
86+
guid = (customMessage.receiver as Group).guid;
87+
}
88+
Map<String, dynamic> id =
89+
UIEventUtils.createMap(uid, guid, customMessage.parentMessageId);
90+
91+
CometChatUIEvents.hidePanel(id, CustomUIPosition.messageListBottom);
92+
}
93+
94+
@override
95+
void ccMessageSent(BaseMessage message, MessageStatus messageStatus) {
96+
String? uid;
97+
String? guid;
98+
if (message.receiverType == ReceiverTypeConstants.user) {
99+
uid = message.receiverUid;
100+
} else {
101+
guid = message.receiverUid;
102+
}
103+
Map<String, dynamic> id =
104+
UIEventUtils.createMap(uid, guid, message.parentMessageId);
105+
106+
CometChatUIEvents.hidePanel(id, CustomUIPosition.messageListBottom);
107+
}
108+
66109
@override
67110
void onSchedulerMessageReceived(SchedulerMessage schedulerMessage) {
68-
Map<String, dynamic> id = {};
111+
String? uid;
112+
String? guid;
113+
if (schedulerMessage.receiverType == ReceiverTypeConstants.user) {
114+
uid = (schedulerMessage.sender as User).uid;
115+
} else {
116+
guid = (schedulerMessage.receiver as Group).guid;
117+
}
118+
Map<String, dynamic> id =
119+
UIEventUtils.createMap(uid, guid, schedulerMessage.parentMessageId);
69120

70-
if (schedulerMessage.receiver is User) {
71-
id['uid'] = (schedulerMessage.sender as User).uid;
72-
} else if (schedulerMessage.receiver is Group) {
73-
id['guid'] = (schedulerMessage.receiver as Group).guid;
121+
CometChatUIEvents.hidePanel(id, CustomUIPosition.messageListBottom);
122+
}
123+
124+
@override
125+
void onFormMessageReceived(FormMessage formMessage) {
126+
String? uid;
127+
String? guid;
128+
if (formMessage.receiverType == ReceiverTypeConstants.user) {
129+
uid = (formMessage.sender as User).uid;
130+
} else {
131+
guid = (formMessage.receiver as Group).guid;
74132
}
133+
Map<String, dynamic> id =
134+
UIEventUtils.createMap(uid, guid, formMessage.parentMessageId);
135+
136+
CometChatUIEvents.hidePanel(id, CustomUIPosition.messageListBottom);
137+
}
75138

76-
if (schedulerMessage.parentMessageId != 0) {
77-
id['parentMessageId'] = schedulerMessage.parentMessageId;
139+
@override
140+
void onCardMessageReceived(CardMessage cardMessage) {
141+
String? uid;
142+
String? guid;
143+
if (cardMessage.receiverType == ReceiverTypeConstants.user) {
144+
uid = (cardMessage.sender as User).uid;
145+
} else {
146+
guid = (cardMessage.receiver as Group).guid;
78147
}
148+
Map<String, dynamic> id =
149+
UIEventUtils.createMap(uid, guid, cardMessage.parentMessageId);
150+
79151
CometChatUIEvents.hidePanel(id, CustomUIPosition.messageListBottom);
80152
}
81153

82-
checkAndShowReplies(TextMessage textMessage) {
83-
List<String> replies = getReplies(textMessage);
154+
@override
155+
void onCustomInteractiveMessageReceived(
156+
CustomInteractiveMessage customInteractiveMessage) {
157+
String? uid;
158+
String? guid;
159+
if (customInteractiveMessage.receiverType == ReceiverTypeConstants.user) {
160+
uid = (customInteractiveMessage.sender as User).uid;
161+
} else {
162+
guid = (customInteractiveMessage.receiver as Group).guid;
163+
}
164+
Map<String, dynamic> id = UIEventUtils.createMap(
165+
uid, guid, customInteractiveMessage.parentMessageId);
84166

85-
if (replies.isEmpty) return;
167+
CometChatUIEvents.hidePanel(id, CustomUIPosition.messageListBottom);
168+
}
86169

87-
Map<String, dynamic> id = {};
170+
checkAndShowReplies(TextMessage textMessage) {
171+
List<String> replies = getReplies(textMessage);
88172

173+
String? uid;
174+
String? guid;
89175
if (textMessage.receiver is User) {
90-
id['uid'] = (textMessage.sender as User).uid;
91-
} else if (textMessage.receiver is Group) {
92-
id['guid'] = (textMessage.receiver as Group).guid;
176+
uid = (textMessage.sender as User).uid;
177+
} else {
178+
guid = (textMessage.receiver as Group).guid;
93179
}
94180

95-
if (textMessage.parentMessageId != 0) {
96-
id['parentMessageId'] = textMessage.parentMessageId;
97-
}
181+
Map<String, dynamic> id =
182+
UIEventUtils.createMap(uid, guid, textMessage.parentMessageId);
183+
184+
if (replies.isEmpty) {
185+
CometChatUIEvents.hidePanel(id, CustomUIPosition.messageListBottom);
186+
return;
187+
};
98188

99189
onCloseTap() {
100190
CometChatUIEvents.hidePanel(id, CustomUIPosition.messageListBottom);

lib/src/message_list/cometchat_message_list_controller.dart

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,9 +1359,16 @@ class CometChatMessageListController
13591359
update();
13601360
}
13611361
} else {
1362+
for(int i = 0; i < list.length; i++){
1363+
if(list[i].muid == message.muid){
1364+
list.removeAt(i);
1365+
update();
1366+
break;
1367+
}
1368+
}
13621369
addElement(message);
1363-
newUnreadMessageCount++;
1364-
update();
1370+
newUnreadMessageCount++;
1371+
update();
13651372
}
13661373
}
13671374
messageId = fetchedList.last.id;

lib/src/messages/cometchat_messages.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ class _CometChatMessagesState extends State<CometChatMessages> {
272272
addReactionIcon: widget.messageListConfiguration.addReactionIcon,
273273
addReactionIconTap: widget.messageListConfiguration.addReactionIconTap,
274274
emojiKeyboardStyle: widget.messageListConfiguration.emojiKeyboardStyle,
275-
favoriteReactions: widget.messageListConfiguration.favoriteReactions ?? [],
275+
favoriteReactions: widget.messageListConfiguration.favoriteReactions,
276276
reactionsConfiguration: widget.messageListConfiguration.reactionsConfiguration,
277277
);
278278
}

pubspec.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,18 @@ packages:
6161
dependency: "direct main"
6262
description:
6363
name: cometchat_sdk
64-
sha256: "525067909e507ff4613df4158915b6499015a8d2693090fcec0973790bc30e81"
64+
sha256: feafee8841665ff8db324f763d42abfd2fded010045cc56941b8ba2afabcf19b
6565
url: "https://pub.dev"
6666
source: hosted
67-
version: "4.0.7"
67+
version: "4.0.8"
6868
cometchat_uikit_shared:
6969
dependency: "direct main"
7070
description:
7171
name: cometchat_uikit_shared
72-
sha256: b0febd296c68073a577445fa69c04d73caec8ff999e0fdd275558dc0a84da44c
72+
sha256: d4490053dcc0c1048db7e0fd09f7c442f2bdd69d7bc2ce70d5db595d34ac0873
7373
url: "https://pub.dev"
7474
source: hosted
75-
version: "4.2.8"
75+
version: "4.2.9"
7676
cross_file:
7777
dependency: transitive
7878
description:

0 commit comments

Comments
 (0)