diff --git a/assets/icons/chat/aac.svg b/assets/icons/chat/aac.svg
new file mode 100644
index 0000000..61d50bb
--- /dev/null
+++ b/assets/icons/chat/aac.svg
@@ -0,0 +1,54 @@
+
+
+
diff --git a/assets/icons/chat/mp3.svg b/assets/icons/chat/mp3.svg
new file mode 100644
index 0000000..ed8e31e
--- /dev/null
+++ b/assets/icons/chat/mp3.svg
@@ -0,0 +1,57 @@
+
+
+
diff --git a/lib/api/chat/chat_api_client.dart b/lib/api/chat/chat_api_client.dart
index 409295f..43e9f6c 100644
--- a/lib/api/chat/chat_api_client.dart
+++ b/lib/api/chat/chat_api_client.dart
@@ -33,7 +33,6 @@ class ChatApiClient {
},
);
if (!kReleaseMode) {
- print("Status Code is ================" + response.statusCode.toString());
logger.i("res: " + response.body);
}
if (response.statusCode == 200) {
@@ -58,6 +57,7 @@ class ChatApiClient {
return List.from(json.decode(response.body).map((x) => ChatUser.fromJson(x)));
}
+ //Get User Recent Chats
Future getRecentChats() async {
try {
Response response = await ApiClient().getJsonForResponse(
@@ -75,6 +75,7 @@ class ChatApiClient {
}
}
+ // Get Favorite Users
Future getFavUsers() async {
Response favRes = await ApiClient().getJsonForResponse(
"${ApiConsts.chatFavUser}getFavUserById/${AppState().chatDetails!.response!.id}",
@@ -86,6 +87,7 @@ class ChatApiClient {
return ChatUserModel.fromJson(json.decode(favRes.body));
}
+ //Get User Chat History
Future getSingleUserChatHistory({required int senderUID, required int receiverUID, required bool loadMore, bool isNewChat = false, required int paginationVal}) async {
try {
Response response = await ApiClient().getJsonForResponse(
@@ -97,10 +99,12 @@ class ChatApiClient {
}
return response;
} catch (e) {
+ getSingleUserChatHistory(senderUID: senderUID, receiverUID: receiverUID, loadMore: loadMore, paginationVal: paginationVal);
throw e;
}
}
+//Favorite Users
Future favUser({required int userID, required int targetUserID}) async {
Response response = await ApiClient().postJsonForResponse("${ApiConsts.chatFavUser}addFavUser", {"targetUserId": targetUserID, "userId": userID}, token: AppState().chatDetails!.response!.token);
if (!kReleaseMode) {
@@ -110,6 +114,7 @@ class ChatApiClient {
return favoriteChatUser;
}
+ //UnFavorite Users
Future unFavUser({required int userID, required int targetUserID}) async {
try {
Response response = await ApiClient().postJsonForResponse(
@@ -120,7 +125,6 @@ class ChatApiClient {
if (!kReleaseMode) {
logger.i("res: " + response.body);
}
-
fav.FavoriteChatUser favoriteChatUser = fav.FavoriteChatUser.fromRawJson(response.body);
return favoriteChatUser;
} catch (e) {
@@ -129,33 +133,37 @@ class ChatApiClient {
}
}
- Future uploadMedia(String userId, File file) async {
+// Upload Chat Media
+ Future